Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Directly controlling volume
#1
Its easy enough to change a sound device's volume by simulating virtual keys "key(0xAE)", but I've not been able to figure how to directly control volume. Such as: vol(9) or vol(2). Has anyone figured out a way to do this? I've searched MSDN, maybe I missed it. Also, if there is more than one sound device avalible it would great to be able to instruct the function to as to which sound device to change the volume of. Thanks in advance.
Matt B
Matt B
#2
The simplest way is waveOutSetVolume. To have more control, probably should be used mixer... functions, but it is not easy. Also, you can find mixer ActiveX components on the Internet. Most of them aren't free.

Code:
Copy      Help
dll winmm.dll #waveOutSetVolume uDeviceID dwVolume
int l r
l=50000
r=50000
out waveOutSetVolume(0 r<<16|l)

bee


Forum Jump:


Users browsing this thread: 1 Guest(s)