Pregunta

How can I check and change the system volume in Windows using C#, like so:

if(SystemVolume.vol == 0){
    SystemVolume.vol = 100;
}
¿Fue útil?

Solución 2

Look into the concept of "audio sessions" in windows. There are some interfaces suggested by the following link, namely ISimpleAudioVolume, IChannelAudioVolume, and IAudioStreamVolume interfaces.

The code examples given are in C++ though, but it should be useful.

Otros consejos

For Windows 10 I created a package called AudioControl.

//Returns a float containing the value (ranging from 0 to 1.0f)
var volume = AudioControl.GetMasterVolume();

//Set the volume (use values between 0 and 1.0f)
AudioControl.SetMasterVolume(1.0f); 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top