Hi guys, got a bit of a problem.
I am making a program (an alarm clock :P) 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.
Sound Problems :D
Started by Nille, Jun 20 2008 03:46 AM
1 reply to this topic
#1
Posted 20 June 2008 - 03:46 AM
|
|
|
#2
Posted 22 June 2008 - 05:15 PM
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:
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.


Sign In
Create Account


Back to top









