Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically set the system volume?

Tags:

c#

.net

audio

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

like image 755
Paedow Avatar asked Oct 30 '12 12:10

Paedow


1 Answers

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; 
like image 180
Vman Avatar answered Oct 04 '22 08:10

Vman