SND_CalcDecibelSquare

Syntax

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

Arguments

scale The square of the scale value. Takes a value between 0 and 127.

Return Values

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

Description

Calculates the decibel value that corresponds to the square of the scale value.

The calculation is performed using the following equation:

20 x log10(( scale ÷ 127 ) ** 2) 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

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


CONFIDENTIAL