SND_CalcDecibel

C Specification

#include <nitro/snd.h>
s16 SND_CalcDecibel( int scale );

Arguments

scale The scale value. Takes a value between 0 and 127.

Return Values

Returns the decibel value that corresponds to the scale value. Value is in units of 0.1dB

Description

Calculates the decibel value.

The calculation is performed using the following equation:

20 x log10( scale / 127 ) x 10

Because the unit is 0.1dB, the number is multiplied by 10 as the final step.

When scale is 0, it returns -32768.

See Also

None.

Revision History

09/22/2005 Added explanation of when the scale value is 0.
07/20/2004 Initial version.