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:
- A media playback app might want to cross fade songs n and n + 1 in a playlist; it could do this by playing the songs in different streams, gradually bringing the volume for song n down to zero, while simultaneously bringing the volume for song n + 1 up to full.
A game might offer distinct volume controls for:
- The background music in the game
- The sound effects (gunshots, explosions, and so on)
- Voice chat in the game
The first two would likely be in the same session and would thus use stream volume controls (exposed via the game UI – Windows does not offer UI for stream volume.) The third could very well be a different session, and even use a different device – the background music and sound effects might go to the default console device (e.g., speakers) while the voice chat might go to the default communications device (e.g., a headset.)
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.
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.
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”.)