BASS.NET API for the Un4seen BASS Audio LibraryBassMixBASS_Mixer_ChannelGetPosition Method (Int32, BASSMode)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the playback position of a mixer source channel.

Namespace: Un4seen.Bass.AddOn.Mix
Assembly: Bass.Net (in Bass.Net.dll) Version:

public static long BASS_Mixer_ChannelGetPosition(
	int handle,
	BASSMode mode


Type: SystemInt32
The mixer source channel handle (which was add via BASS_Mixer_StreamAddChannel(Int32, Int32, BASSFlag) or BASS_Mixer_StreamAddChannelEx(Int32, Int32, BASSFlag, Int64, Int64)) beforehand).
Type: Un4seen.BassBASSMode
BASS_POS_BYTEGet the position in bytes.
BASS_POS_MUSIC_ORDERGet the position in orders and rows... LoWord = order, HiWord = row * scaler (BASS_ATTRIB_MUSIC_PSCALER). (HMUSIC only).
Other modes and flags may be supported by add-ons, see the documentation.

Return Value

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

This function is like the standard BASS_ChannelGetPosition(Int32, BASSMode), but it compensates for the mixer's buffering to return the source channel position that is currently being heard. So when used with a decoding channel (eg. a mixer source channel), this method will return the current decoding position. But if the mixer output is being played, then there is a playback buffer involved. This function compensates for that, to return the position that is currently being heard. If the mixer is not being played by BASS, it is possible to account for any other output system latency with the BASS_ATTRIB_MIXER_LATENCY option or the BASS_Mixer_ChannelGetPositionEx(Int32, BASSMode, Int32) function.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not plugged into a mixer.
BASS_ERROR_NOTAVAILThe requested position is not available.
BASS_ERROR_UNKNOWNSome other mystery problem!

See Also