volumeToGain
function volumeToGain(volume): number;Convert a volume percentage to the gain applied to the PCM stream.
The curve compensates the loudness perception of the raw sample scaling, so
50 sounds roughly half as loud as 100 instead of being 6 dB quieter.
Parameters
Section titled “Parameters”volume
Section titled “volume”number
The volume percentage, from 0 to 100
Returns
Section titled “Returns”number
The gain to apply to every sample