BASS.NET API for the Un4seen BASS Audio Library

BassWasapiBASS_WASAPI_GetLevel Method (Single, 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.17.5
Syntax

[DllImportAttribute("basswasapi", EntryPoint = "BASS_WASAPI_GetLevelEx")]
public static bool BASS_WASAPI_GetLevel(
	float[] levels,
	float length,
	BASSLevel flags
)

Parameters

levels
Type: SystemSingle
The array in which the levels are to be returned.
length
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
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: Boolean
On success is returned - else , use BASS_ErrorGetCode to get the error code.

If successful, the requested levels are returned in the levels array.

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