Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C and C++

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-20-2008, 07:46 AM
Nille's Avatar   
Nille Nille is offline
Learning Programmer
 
Join Date: Apr 2007
Location: Sweden
Age: 19
Posts: 37
Rep Power: 6
Nille is on a distinguished road
Default Sound Problems :D

Hi guys, got a bit of a problem.
I am making a program (an alarm clock ) and i want to be able to increase the system sound volume (might be the wrong name for it but anyways) but i dont know quite how to, i found 2 pages on msdn (Microsoft developer network)
waveOutGetVolume
and
waveOutSetVolume
but i don't quite understand how to use it.
I understand that the sound is increased and decreased by setting the value of a variable.
What i don't understand is how to declare that variable and how to make the volume change as i change the variables value.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-22-2008, 09:15 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 793
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default Re: Sound Problems :D

First you need to get the handle of the sound device you're using, then pass in the handle and volume to the waveOutSetVolume function:

Code:
HWAVEOUT  hSpeaker = NULL;

//You need to fill this structure out depending on what sound you're using
WAVEFORMATEX  soundData;

//get handle to speaker
waveOutOpen(&hSpeaker,WAVE_MAPPER,&soundData,NULL,CALLBACK_NULL);

//speaker now opened for output. Set the volume.
waveOutSetVolume(hSpeaker,/*your volume here, 0xFFFF is max*/);

//do your thing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sound gone from flash video's? zeroradius Computer Software/OS 17 05-18-2008 11:32 AM
Do you like to solve programming problems? Rhiever General Programming 1 03-21-2008 09:53 AM
Interacting with the sound card... FlyByWire128 General Programming 1 02-05-2008 08:29 AM
Joypad Sound Trigger JohanR General Programming 1 11-30-2007 09:37 AM
Sounds and Sound Loop Resources TVDinner Website Design 0 03-10-2007 09:20 AM


All times are GMT -5. The time now is 05:11 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads