Retrieves the level of a playing stream, or MOD music channel.
DWORD WINAPI BASS_ChannelGetLevel( |
Parameters
handle | The channel handle... a HMUSIC, HSTREAM. |
Return value
If an error occurs, 0xFFFFFFFF 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), and the level of the right channel is returned in the high word (high 16 bits). If the channel is mono, then the high word is 0. The level ranges linearly from 0 (silent) to 128 (max).
Error codes
BASS_ERROR_HANDLE | handle is not a valid channel. |
BASS_ERROR_NOPLAY | The channel is not playing. |
BASS_ERROR_MEM | There is insufficent memory. |
BASS_ERROR_BUFLOST | Should not happen, but... PLEASE REPORT IT IF YOU DO GET THIS ERROR! |
Remarks
The channel's volume (as set with BASS_ChannelSetAttributes) does not affect the value returned by this function... it measures the level of the channel's sample data and not the level of the channel in the final output mix.
Example
To get the left and right levels of a stereo channel.
DWORD level,left,right; |
See also
BASS_ChannelGetData, BASS_ChannelIsActive