BASS_ASIO_ChannelEnableMirror

Enables an output channel, and makes it mirror another channel.

BOOL BASS_ASIO_ChannelEnableMirror(
    DWORD channel,
    BOOL input2,
    DWORD channel2
);

Parameters

channelThe output channel number... 0 = first.
input2Mirroring an input channel? FALSE = an output channel.
channel2The channel to mirror.

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 and the channel is not currently enabled. The device needs to be stopped before enabling channels.
BASS_ERROR_ILLPARAMAt least one of the channels is invalid.
BASS_ERROR_FORMATIt is not possible to mirror channels that do not have the same sample format.

Remarks

This function allows an input or output channel to be duplicated in other output channel. This can be achieved using normal ASIOPROC processing, but it is more efficient to let BASSASIO simply copy the data from one channel to another.

Mirror channels cannot be joined together to form multi-channel mirrors. Instead, to mirror multiple channels, an individual mirror should be setup for each of them.

After BASS_ASIO_Start has been called to begin processing, it is not possible it setup new mirror channels, but it is still possible to change the channel that a mirror is mirroring.

When mirroring an output channel that has not been enabled, the mirror channel will just produce silence. When mirroring an input channel that has not already been enabled, the channel is automatically enabled for processing when BASS_ASIO_Start is called, so that it can be mirrored. If the mirror is switched to a disabled input channel once processing has begun, then it will produce silence.

A mirror channel can be made to have a different volume level to the channel that it is mirroring, using BASS_ASIO_ChannelSetVolume. The volume setting is cumulative. For example, if the mirror channel has a volume setting of 0.5 and the mirrored channel has a volume setting of 0.4, the effective volume of the mirror channel will be 0.2 (0.5 x 0.4).

BASS_ASIO_ChannelEnable can be used to disable a mirror channel.

Example

Enable output channel 0, and mirror it to channel 1 for stereo output.
BASS_ASIO_ChannelEnable(FALSE, 0, MyAsioProc, 0); // enable processing of output channel 0
BASS_ASIO_ChannelEnableMirror(1, FALSE, 0); // mirror it to channel 1

See also

BASS_ASIO_ChannelEnable, BASS_ASIO_ChannelIsActive, BASS_ASIO_ChannelReset, BASS_ASIO_ChannelSetVolume, BASS_ASIO_Start