Changing the master volume and muted state from UWP should be a simple API call, right? Unfortunately it isn’t that easy.
Windows 10 volume slider is not working – If you are trying to control volume from the Taskbar but it is not working at all. Volume mixer won’t open – You are unable to open Volume Mixer. The volume icon is not working – You can not change the volume by clicking on the Volume icon. This episode provides useful answers addressing the best way to adjust the volume for an audio event in Cubase when pre-mixer or post-mixer. Let Greg Ondo te. Control App Volume with the Windows Volume Mixer To open the Volume Mixer, just right-click the speaker icon on your system tray and select “Open Volume Mixer.” When you first open it, Volume Mixer will likely just show two volume sliders: Device (which controls the master volume) and System Sounds. Save the patches that you are going to use 'live' (for home practice doesn't matter as much) at the same volume by adjusting the channel volumes for the patches. Then the master volume is used to adjust the overall volume for where you are playing. Channel volume adjusts the preamp, master volume adjusts the amp.
You can change volume levels using AudioGraph and MediaPlayer. But this only affects the volume levels within the app itself. There’s no way to change the volume of the ‘default audio rendering device’.
Searching StackOverflow returns two relevant hits:
Audio Volume Changer
The second post contains an answer that put me on the right track:
You can get or set the volume of an audio device the same way that we used to do in desktop apps using IAudioEndpointVolume, the documentation states that it is supported in Windows Store Apps
However, this answer does not contain a complete working solution for C#.
Eventually I found a ‘working’ solution on this reddit.
It worked great!….when debugging. As soon as I compiled to native code (Release), my app crashed using the IAudioEndpointVolume API.
Volume Changer Extension
Apart from the code crashing my app, it is ‘unsafe’ code as well. If there’s no need for code to be unsafe, it shouldn’t be.
I suspected that the crash was caused by the unsafe code (using raw Guid pointers)
Twitter search advanced. After replacing the IAudioEndpointVolume definition, lo and behold, I’ve got no unsafe code and crashes anymore!
Terminus sublime text 3. You can find a working solution in my GitHub Gist
It works this way, but it would be better if there was just an API that provided this functionality. Please vote for it on UserVoice!
See also this thread on my twitter feed for an alternative solution using Desktop Bridge. In my opinion Desktop Bridge should only be used as a last resort.
Master Volume Booster
I often get lots of questions about master volume controls. Can I add one in? Will the amp sound the same? What’s the difference between non-master and master volume amps? What about Post Phase Inverter and Pre Phase Inverter Master Volumes? Here are few answers to common questions about them:
What is a master volume?
A master volume are basically allows the user to turn up the pre-amp section while controlling the signal going to the power amp thus controlling the overall volume of the amp. In a non-master volume amp this control does not exist. The volume on a non-master volume amp is the same control as the gain, drive or pre level control on an amp with a master volume.
What affect does this have on the sound?
In general non-master volume amps are more dynamic and responsive to the player‘s touch since the pre-amp is directly interacting with the power amp. The overdrive is usually power tube breakup or combination of pre-amp and power amp breakup which sounds different. The clean and semi-clean tones are one of the places these amps really shine. A player can control breakup by varying their pick attack and adjusting the knobs on the guitar. However this is not really very practical in many locations a player would use the amp.
For overdrive and distortion in master volume amps the pre-amp is high gain. The pre-amp overdrive tends to be at bit buzzier but also more and more of a square wave. Some players like it and some do not but it is practical way to get distorted tones without high volume. There are many ways to shape a distorted pre-amp to fit a player's needs. The advent of hi-gain amps gave players distortion tones without ear bleeding volumes but changed the tone too.

Can I add a master volume to a non master volume amp ?
Some vintage amp designs can have master volumes added but most behave differently with a master volume installed. Drivers ctl. In others adding a master volume simply has no real benefit so this must be evaluated on case by case basis.
One amp that master volumes are commonly added to are Marshall Plexi amps. Some Plexi amps are ridiculously loud and the classic plexi crunch sound depends on power tube breakup and speakers being pushed hard. A master volume may help quiet things down but you will still have to play reasonably loud to get the sound people typically associate with those amps. The sound is simply not the same with the master as without. That is not to say it won't sound good with a master---just different. A combination of a master volume and an attenuator is often needed for such amp. A better solution for many players who want real power tube breakup is to use a lower wattage amp or an amp with London Power Scaling like some of the model we build at Carl’s Custom Amps.
Online Volume Changer

Post Phase Inverter vs. Pre-Phase Inverter Master Volumes?
These two types of masters simply place the master volume in a different places in the amp. Many Post-Phase Inverter Master Volumes have the advantage that when turned all the way up they are out the circuit. Thus the amp retains it’s function as a non-master volume amp. However I find that Post-Phase Inverter Master Volumes need the amp to be turned up more to sound good. No matter what all master volumes affect the tone--- they sound different when in use and should be selected for a player‘s needs.
The standard master volume works well in amps designed for them. On phenomenon that an occur is that the tone tone of the amp changes with the sweep of the control. Often the low setting doe snot sound as full. This is common on many amps with the Marshall JCM 800 being a prime example. A simple mod will correct this—-I often do this for players and they love the mod.
If have questions about putting one in your amp or removing one from your amp contact me for service and expert advice!
