Retrieves the level.

    float *levels,
    float length,
    DWORD flags


levelsAn array to receive the levels.
lengthThe amount of data to inspect to calculate the level, in seconds. The maximum is 1 second. Less data than requested may be used if the full amount is not available, eg. if the device's buffer is shorter.
flagsA combination of these flags.
BASS_LEVEL_MONOGet a mono level. If neither this or the BASS_LEVEL_STEREO flag is used, then a separate level is retrieved for each channel; the number of channels is available from BASS_WASAPI_GetInfo.
BASS_LEVEL_STEREOGet a stereo level. The left level will be from the even channels, and the right level will be from the odd channels. If there are an odd number of channels then the left and right levels will both include all channels.
BASS_LEVEL_RMSGet the RMS level. Otherwise the peak level.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_INITBASS_WASAPI_Init has not been successfully called.
BASS_ERROR_NOTAVAILThe BASS_WASAPI_BUFFER flag was not specified in the device's initialization.
BASS_ERROR_ILLPARAMlength is not valid.


This function uses BASS_ChannelGetLevelEx internally, so it behaves identically to that.

The BASS_WASAPI_BUFFER flag needs to have been specified in the device's initialization to enable the use of this function.

See also