Linearity of Windows volume APIs – render session and stream volumes


We have talked about some of the volume APIs Windows exposes. We have also
talked about what it means for a volume control to be linear in magnitude, linear in power, or
linear in dB
. We have also talked about how to read IAudioMeterInformation and how the
limiter can attenuate full-scale signals.

The last post had a volume-linearity.exe which, when called with –signal, showed that IAudioMeterInformation is linear in amplitude.

Today we’ll look at the –stream, –channel, and –session
arguments, which explore the linearity of IAudioStreamVolume, IChannelAudioVolume, and
ISimpleAudioVolume respectively. Each of these modes plays a half-scale square wave, then set the volume
API to various levels, and reads the resulting IAudioMeterInformation. We use a half-scale square wave to avoid
running afoul of the limiter; we expect a meter reading of 0.5 when the volume is set to 1.  The graphs below have their meter readings doubled to account for the fact that we’re using a half-scale square wave rather than a full-scale.

Here’s what we get for IAudioStreamVolume, graph-inated for your convenience:

And IChannelAudioVolume:

And ISimpleAudioVolume:

We already know that IAudioMeterInformation is linear in amplitude. We now know that
IAudioStreamVolume, IChannelAudioVolume, and ISimpleAudioVolume have a linear effect (with slope 1
and intercept 0) on IAudioMeterInformation. We infer that IAudioStreamVolume, IChannelAudioVolume,
and ISimpleAudioVolume are linear in amplitude.

Comments (0)

Skip to main content