Here’s a dirty little secret about volume in Windows.
If you look at the documentation for waveOutSetVolume it very clearly says:
|Volume settings are interpreted logarithmically. This means the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.|
The implication of this is that you can implement a linear slider for volume control and use the position of the slider to represent the volume. This is pretty cool.
But if you’ve ever written an application that uses the waveform volume (say an app that plays content with a volume slider attached to it), you’ll notice that your volume control is far more responsive when it’s on the low end of the slider and less responsive on the high end of the slider.
That’s weird. The volume settings are supposed to be logarithmic, but a slider that’s more responsive at the low end of the scale than the high end of the scale is an indicator that the slider’s controlling LINEAR volume.
And that’s the dirty little secret. Even though the wave volume is supposed to be logarithmic, the wave volume is actually linear.
What’s worse is that we didn’t notice this until we shipped Media Center Edition. The PM for my group was playing with his MCE machine and noticed that the volume was linear. To confirm it, he whipped out his sound pressure meter (he’s a recording artist so he has stuff like that in his house). And yup, the volume control was linear.
When he came back to work the next day, panic ensued. I can’t explain WHY nobody had noticed this, but they hadn’t.
In response, we added support (for XP SP2) for customized volume tapers for the audio APIs. The results of that are discussed in this article.
Interestingly enough, it appears that this problem is well known. The article from which I stole this image discusses the problem of linear vs. logarithmic tapers and discusses how to find the optimal volume taper.
Edit: Cleared up some ambiguities in the language.