BASS.NET API for the Un4seen BASS Audio LibraryBassWasapiBASS_WASAPI_GetLevel Method (Single, BASSLevel)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the level of the current Wasapi device/driver (endpoint).

Namespace: Un4seen.BassWasapi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public static float[] BASS_WASAPI_GetLevel(
	float length = 0,02f,
	BASSLevel flags = BASSLevel.BASS_LEVEL_ALL
)

Parameters

length (Optional)
Type: SystemSingle
The 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.
flags (Optional)
Type: Un4seen.BassBASSLevel
What levels to retrieve. One of the following (see BASSLevel):
BASS_LEVEL_ALLRetrieves a separate level for each channel.
BASS_LEVEL_MONORetrieve a single mono level.
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_RMSFlag: Get the RMS level. Otherwise the peak level.

Return Value

Type: Single
On success is returned - else , use BASS_ErrorGetCode to get the error code.

If successful, the requested levels are returned.

Remarks

This function uses BASS_ChannelGetLevel(Int32) 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.

ERROR CODEDescription
BASS_ERROR_INITBASS_WASAPI_Init(Int32, Int32, Int32, BASSWASAPIInit, Single, Single, WASAPIPROC, IntPtr) 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.

See Also

Reference