Skip to content
Igor Zinken edited this page Dec 22, 2018 · 2 revisions

See <utilities/levelutility.h>

LevelUtility provides methods to determine the mean level of an audio signal, which can be used for UI representations (for instance: creation of level meters).

It is up to your implementation to determine when and how often you query these. It is not recommended to do a live update on each of the engine's audio rendering iterations but rather on a scale that human vision can pick up (in other words: no need to go faster than your views frame rate!).

You can experiment by animating the visual representation between previous and new values to simulate the effect of a VU meter on a mixing desk.

Public static methods

SAMPLE_TYPE RMS( AudioChannel* audioChannel, int channelNum )

Calculates the root mean square of the given _audioChannel_s signal. channelNum describes which channel of the given channels buffer to evaluate (e.g. 0 for left, 1 for right when running in stereo).

SAMPLE_TYPE dBSPL( AudioChannel* audioChannel, int channelNum )

Calculates the sound pressuree of the given _audioChannel_s signal. channelNum describes which channel of the given channels buffer to evaluate (e.g. 0 for left, 1 for right when running in stereo).

SAMPLE_TYPE linear( AudioChannel* audioChannel, int channelNum )

Calculates the linear energy of the given _audioChannel_s signal. channelNum describes which channel of the given channels buffer to evaluate (e.g. 0 for left, 1 for right when running in stereo).

Clone this wiki locally