Getting and Setting the Master and Wave Volume
-
How would I go about using the .NET Framework to get and set the Master and Wave Volume of the user's computer? Can it be done with .NET, or is Direct Sound required to do this? Any leads in the right direction would be appreciated. Happy Programming and may God Bless! "Your coding practices might be buggy, but your code is always right." Internet::WWW::CodeProject::bneacetp
-
How would I go about using the .NET Framework to get and set the Master and Wave Volume of the user's computer? Can it be done with .NET, or is Direct Sound required to do this? Any leads in the right direction would be appreciated. Happy Programming and may God Bless! "Your coding practices might be buggy, but your code is always right." Internet::WWW::CodeProject::bneacetp
You can P/Invoke
waveOutSetVolume()
to set the volume of a waveform audio output device.[DllImport("winmm.dll")] public static extern int waveOutSetVolume(IntPtr hwo, UInt32 dwVolume); ... waveOutSetVolume(IntPtr.Zero, 0xFFFFFFFF); ...
This sets both channels of master volume to maximum. For special target devices you might have to use other WaveOut-functions, but they're all documented in the platform SDK. Regards, mav
-
You can P/Invoke
waveOutSetVolume()
to set the volume of a waveform audio output device.[DllImport("winmm.dll")] public static extern int waveOutSetVolume(IntPtr hwo, UInt32 dwVolume); ... waveOutSetVolume(IntPtr.Zero, 0xFFFFFFFF); ...
This sets both channels of master volume to maximum. For special target devices you might have to use other WaveOut-functions, but they're all documented in the platform SDK. Regards, mav