BASS.NET API for the Un4seen BASS Audio Library

BassLoudBASS_Loudness_GetLevel Method

BASS.NET API for the Un4seen BASS Audio Library
Starts loudness measurement on a channel.

Namespace:  Un4seen.Bass.AddOn.Loud
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.18.2
Syntax

[DllImportAttribute("bassloud")]
public static bool BASS_Loudness_GetLevel(
	int handle,
	BassLoudness mode,
	ref float level
)

Parameters

handle
Type: SystemInt32
The channel handle... a HSTREAM, HMUSIC, or HRECORD.
mode
Type: Un4seen.Bass.AddOn.LoudBassLoudness
The measurement type to retrieve. One of the following BassLoudness:
BASS_LOUDNESS_CURRENTLoudness in LUFS of the last 400ms or the duration (in milliseconds) specified in the HIWORD (use MakeLong(Int16, Int16)).
BASS_LOUDNESS_INTEGRATEDIntegrated loudness in LUFS. This is the average since measurement started.
BASS_LOUDNESS_RANGELoudness range in LU.
BASS_LOUDNESS_PEAKPeak level in linear scale.
BASS_LOUDNESS_TRUEPEAKTrue peak level in linear scale.
level
Type: SystemSingle
The returned single measurement level (eg. weighted over all channels, stereo, 5.1 etc.).

Return Value

Type: Boolean
If successful, is returned, else is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

Loudness is measured according to the ITU-R BS.1770-4 standard (LUFS = LKFS). The BASS_LOUDNESS_INTEGRATED measurement is gated so that much quieter periods are excluded and do not bring down the measured level, while the other measurements are not gated. Loudness (not peak) levels will be -infinity in the case of pure silence, or if the minimum amount of data has not been processed yet. The BASS_LOUDNESS_INTEGRATED measurement requires at least 400ms of data and is updated every 100ms after that. The BASS_LOUDNESS_RANGE measurement requires at least 4s of data and is updated every 1s after that. The other measurements are updated with every sample, but the BASS_LOUDNESS_CURRENT levels may be lower than expected before the requested duration has been processed.

The BASS_LOUDNESS_CURRENT mode can be used with durations of 400ms and 3000ms to get EBU R128 "momentary" and "short-term" loudness levels, respectively. The other modes are equivalent to the EBU R128 measurements of the same name.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_ILLPARAMmode is not valid. If requesting a duration with BASS_LOUDNESS_CURRENT then it exceeds what has been enabled.
BASS_ERROR_NOTAVAILThe requested measurement has not been enabled.

See Also

Reference