I need some general method to change master audio volume from Windows XP to Windows 8 in C# because my application is going to work on those OS.
I h
For windows 7+:
There are some problems with the accepted answer. Because the codeproject page is deleted it now has no context.
You need to get NAudio from Nuget
Replace the first with the second
MMDevice device = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
MMDevice device = DevEnum.GetDefaultAudioEndpoint((DataFlow)0, (Role)1);
Just a quick heads-up if you are lost trying to fix the errors with the accepted-answer code.