Links two MOD music or stream channels together.

BOOL BASS_ChannelSetLink(
    DWORD handle,
    DWORD chan


handleThe channel handle... a HMUSIC or HSTREAM.
chanThe handle of the channel to have linked with it... a HMUSIC or HSTREAM.

Return value

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

Error codes

BASS_ERROR_HANDLEAt least one of handle and chan is not a valid channel.
BASS_ERROR_DECODEAt least one of handle and chan is a decoding channel, so cannot be linked.
BASS_ERROR_UNKNOWNSome other mystery problem!


Linked channels are started/stopped/paused/resumed together. Linked channels on the same device are guaranteed to start playing simultaneously. Links are one-way: channel chan will be started by channel handle, but not vice versa unless another link has been set in that direction.

If a linked channel has reached the end, it will not be restarted when a channel it is linked to is started. If you want a linked channel to be restarted, you will need to have resetted its position using BASS_ChannelSetPosition beforehand.


Link 2 streams and play them together.
BASS_ChannelSetLink(stream1, stream2); // link stream2 to stream1
BASS_ChannelStart(stream1); // start both streams together

See also