Search code examples
c#winformsvolume

How do I check the system volume?


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

if(SystemVolume.vol == 0){
    SystemVolume.vol = 100;
}

Solution

  • 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.