BASS_Mixer_StreamSetLatency

Sets a latency provider on a mixer.

BOOL BASS_Mixer_StreamSetLatency(
    HSTREAM handle,
    MIXERLATENCYPROC *proc,
    void *user
);

Parameters

handleThe mixer handle.
procThe latency providing callback function... NULL = none.
userUser instance data to pass to the callback function.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not a valid mixer handle.
BASS_ERROR_DECODEThe mixer is not a decoding channel (it is being played by BASS).
BASS_ERROR_NOTAVAILThe mixer does not have the BASS_MIXER_POSEX flag set.

Remarks

When a mixer is played by BASS, the BASS_Mixer_ChannelGetData, BASS_Mixer_ChannelGetLevel, BASS_Mixer_ChannelGetLevelEx, and BASS_Mixer_ChannelGetPosition functions will get the output latency and account for that so that they reflect what is currently being heard. This function provides a way for them to get the output latency when the mixer is not being played by BASS. The mixer needs to have the BASS_STREAM_DECODE and BASS_MIXER_POSEX flags set for this.

The output latency also affects the timing of non-mixtime sync callbacks set via BASS_Mixer_ChannelSetSync.

The latency can also be set via the BASS_ATTRIB_MIXER_LATENCY attribute. If that attribute and this function are both used, this function has priority.

See also

BASS_ATTRIB_MIXER_LATENCY, MIXERLATENCYPROC callback