Changing Master Volume in C++ [Solved]

Started by
1 comment, last by Chett2001 16 years, 10 months ago
Hey anyone got a simple example of how to ajust the master volume in C++? I cant seem to find any good tutorials or documentation, surely this is possible? Edit: im not talking about using sliders in a GUI either, im developing in DirectX and i have two custom buttons that i want to volume to turn the system volume up or down a set amount. [Edited by - Chett2001 on June 3, 2007 11:13:09 AM]
Chett - "I look forward to helping all of you one day, but right now im just a noob learning his way through the perils of game Development."
Advertisement
Have a look at the waveout-API, especially waveoutSetVolume.
Awesome, i got it working but for some reason when i try to place the volume at max the balance moves all the way to the left speaker it specifies in the MSDN this:

"If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored."

heres the code:

waveOutSetVolume(audioDevice,(0xFFFF);

What do a need to change? my appologies if im being dense :(

edit: i get it, i just needed to change the DWORD value to 0xFFFFFFFF because my device supports left and right volume control.. Well its working so i guess thats right !!
Chett - "I look forward to helping all of you one day, but right now im just a noob learning his way through the perils of game Development."

This topic is closed to new replies.

Advertisement