Matthew van Eerde's web log
I am a Software Development Engineer in Test working for the Windows Sound team. You can contact me via email: mateer at microsoft dot com
Friend key: 28904932216450_59cd9d55374be03d8167d37c8ff4196b
Windows has four different volume settings for any given piece of audio; they are all applied simultaneously. For example, if one of these settings is muted, you will not hear the audio, even if the others are turned up to "full". Here they are, from local to global:
The WASAPI API for this is IAudioStreamVolume.
This most local volume control is used only in rather specialized situations. If a particular app wants to play multiple audio streams to the same audio device, and in the same session (see below), but wants to control the volumes for the streams independently, this is the volume control to use. For example:
Apps could also get these same effects by doing their own mixing and volume handling, and playing a single stream to the Windows audio engine, of course.
By and large, this is the volume control that apps most commonly use. The WASAPI APIs for this are ISimpleAudioVolume and the more-rarely used IChannelAudioVolume.
This is what people mean when they say "application volume" - a session is, by and large, an app (though there are exceptions in both directions.) This is the "S" in "WASAPI" - Windows Audio Session API.
The session volume shows up in the Volume Mixer - each "Application" slider is a session volume control. This is also usually (but not always) tied to a volume control in the app.
The WASAPI API for this is IAudioEndpointVolume. Apps should generally prefer ISimpleAudioVolume to this because IAudioEndpointVolume will affect all apps on the system.
This is what people mean when they say "system volume." It is exposed in the following three places in the UI. Note if you have multiple audio devices, each has its own setting.
More about ducking
When you get a phone call or start a voice chat, Windows (starting in Windows 7) will attenuate (or "duck") all of the audio on the system (except for phone calls and voice chats.) This is the "most global" because it affects all streams on all audio devices. Note that this volume control only has three settings (four if you count "mute".)
Larry Osterman did a series of audio volume posts - one of them contains much of the information in this post, though the ducking feature was added after his post.
Surely endpoint volume is more global than ducking?
"IAudioEndpointVolume will affect all apps on the system."
Ducking only affects "all of the audio on the system (except for phone calls and voice chats.)"
A reasonable question - ducking is both more and less global than endpoint volume.
Endpoint volume affects a particular device. If you have an HDMI output, USB speakers, a headphone jack, and a Bluetooth headset, then the endpoint volume on the USB speakers will affect only the speakers.
Ducking will affect all audio streams, across all devices (this is the part where it is more global) with two exceptions (this is the part where it is less global:)
* Communications streams are not impacted
* Apps that have opted-out of ducking are not impacted