Audio Mixer audible volume interval question

We’ve implemented a slider control (Values ranging from -80 to 0) for our in-game BGM volume, and we’re doing it by exposing the attenuation volume parameter of the mixer. Everything seems fine and dandy, but we noticed that most tracks become barely audible at around halfway through the slider, which does seem rather odd. Is this kind of behavior expected? Can anyone shed some light on this matter? Thanks in advance!

That’s because dB is logarithmic and not linear and therefore perfectly normal [1]. If you want your slider control to “feel linear” you’d have to implement some math that translates say values from 0-100 to corresponding dB values (search for “convert decibel to linear float” or sth. the like).

Hope that helps.

1 Like

Just in case someone need, I converted from linear to decibels by using:

var dB = 20f * Mathf.Log10(linearValue * linearValue); // linearValue ranges 0.0 to 1.0
if (float.IsInfinity(dB))
    dB = -80f;
2 Likes