BASSmix

BASS_Mixer_ChannelGetPosition


Retrieves the playback position of a mixer source channel.

QWORD BASS_Mixer_ChannelGetPosition(
    DWORD handle,
    DWORD mode
);

Parameters

handleThe channel handle.
modeHow to retrieve the position. One of the following.
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 may be supported by add-ons, see the documentation.

Return value

If successful, then the channel's position is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

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

Remarks

This function is like the standard BASS_ChannelGetPosition, but it compensates for the mixer's playback buffering 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 function.

See also

BASS_Mixer_ChannelGetPositionEx, BASS_Mixer_ChannelSetPosition, BASS_Mixer_ChannelSetSync, BASS_ATTRIB_MIXER_LATENCY

BASS_ChannelGetPosition