BASS_ASIO_ChannelJoin


Join a channel to another.

BOOL BASS_ASIO_ChannelJoin(
    BOOL input,
    DWORD channel,
    int channel2
);

Parameters

inputDealing with input channels? FALSE = output channels.
channelThe input/output channel number... 0 = first.
channel2The channel to join it to... -1 = remove current join.

Return value

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

Error codes

BASS_ERROR_INITBASS_ASIO_Init has not been successfully called.
BASS_ERROR_STARTThe device has been started - it needs to be stopped before joining channels.
BASS_ERROR_ILLPARAMAt least one of the channels is invalid.
BASS_ERROR_FORMATIt is not possible to join channels that do not have the same sample format.

Remarks

All ASIO channels are mono. By joining them, stereo (and above) channels can be formed, making it simpler to process stereo (and above) sample data.

By default, channels can only be joined to preceding channels. For example, channel 1 can be joined to channel 0, but not vice versa. The BASS_ASIO_JOINORDER flag can be used in the BASS_ASIO_Init call to remove that restriction. When joining a group of channels, there should be one channel enabled via BASS_ASIO_ChannelEnable with the rest joined to it - do not join a channel to a channel that is itself joined to another channel. Mirror channels, setup using BASS_ASIO_ChannelEnableMirror, cannot be joined with.

If a channel has two or more other channels joined to it, then the joined channels will default to being in numerically ascending order in the ASIOPROC callback function's sample data unless the BASS_ASIO_JOINORDER flag was used in the BASS_ASIO_Init call, in which case they will be in the order in which they were joined via this function. In the latter case, if this function is called on an already joined channel, the channel will be moved to the end of the joined group.

While a channel is joined to another, it automatically takes on the attributes of the other channel - the other channel's settings determine the sample format, the sample rate and whether it is enabled. The volume setting remains individual though, allowing balance control over the joined channels.

Example

Enable an output channel, and join another to make it stereo.
BASS_ASIO_ChannelEnable(FALSE, 0, MyAsioProc, 0); // enable processing of output channel 0
BASS_ASIO_ChannelJoin(FALSE, 1, 0); // join channel 1 to it

See also

BASS_ASIO_ChannelEnable