BASS.NET API for the Un4seen BASS Audio Library

BassWasapiBASS_WASAPI_GetLevel Method

BASS.NET API for the Un4seen BASS Audio Library
Retrieves the level (peak amplitude) 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")]
public static int BASS_WASAPI_GetLevel()

Return Value

Type: Int32
If an error occurs, -1 is returned, use BASS_ErrorGetCode to get the error code.

If successful, the level of the left channel is returned in the low word (low 16-bits, use LowWord32(Int32)), and the level of the right channel is returned in the high word (high 16-bits, use HighWord32(Int32)). If the channel is mono, then the low word is duplicated in the high word. The level ranges linearly from 0 (silent) to 32768 (max). 0 will be returned when a channel is stalled.

Remarks

This function is like the standard BASS_ChannelGetLevel(Int32), but it gets the level from the devices's buffer instead of decoding data from a channel, which means that the device doesn't miss out on any data. 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 device was not initialized using buffering (BASS_WASAPI_BUFFER).

See Also

Reference