How to programmatically set the system volume?

Paedow picture Paedow · Oct 30, 2012 · Viewed 78.6k times · Source

How can I change the Windows System Sound Volume using a C# Application?

Answer

Vman picture Vman · Nov 1, 2016

I'm a bit late to the party but if you are looking now there's a nuget package available (AudioSwitcher.AudioApi.CoreAudio) that simplifies audio interactions. Install it then it’s as simple as:

CoreAudioDevice defaultPlaybackDevice = new CoreAudioController().DefaultPlaybackDevice;
Debug.WriteLine("Current Volume:" + defaultPlaybackDevice.Volume);
defaultPlaybackDevice.Volume = 80;