BASS_ASIO_ChannelEnableBASS

Enables a channel, and sets it to use a BASS channel.

BOOL BASS_ASIO_ChannelEnableBASS(
    BOOL input,
    DWORD channel,
    DWORD handle,
    BOOL join
);

Parameters

inputDealing with an input channel? FALSE = an output channel.
channelThe input/output channel number... 0 = first.
handleThe BASS channel handle.
joinJoin the next ASIO channels according to the number of audio channels in the BASS channel?

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_NOTAVAILThe BASS library is not loaded.
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_ILLPARAMThe input and channel combination is invalid.
BASS_ERROR_HANDLEhandle is invalid.
BASS_ERROR_FORMAT8-bit BASS channels are not supported; the BASS_SAMPLE_FLOAT flag can be used to avoid them.
BASS_ERROR_NOCHANThe device does not have enough channels to accommodate the BASS channel.

Remarks

This function allows BASS channels to be used directly, without needing an ASIOPROC callback function. The ASIO channel's format and rate are set accordingly. If the BASS channel is not mono then multiple ASIO channels should also be joined accordingly. That can be done automatically via the join parameter, or manually with BASS_ASIO_ChannelJoin. If the device does not have enough channels, the BASSmix add-on can be used to downmix the BASS channel.

In the case of output channels, the BASS channel must have the BASS_STREAM_DECODE flag set. In the case of input channels, the BASS channel must be a "push" or "dummy" stream, created with BASS_StreamCreate and STREAMPROC_PUSH or STREAMPROC_DUMMY. A "push" stream will receive the data from the input channel(s), while a "dummy" stream will just apply its DSP/FX (including encoders) to the data.

Raw DSD streams are supported (with the BASSDSD add-on) but the device needs to have been successfully set to DSD mode first with BASS_ASIO_SetDSD. The device's sample rate should also be set to the DSD stream's rate (its BASS_ATTRIB_DSD_RATE attribute) via BASS_ASIO_SetRate.

Example

Play a stereo mixer on the first two output channels.
mixer = BASS_Mixer_StreamCreate(BASS_ASIO_GetRate(), 2, BASS_SAMPLE_FLOAT | BASS_STREAM_DECODE); // create a stereo mixer
BASS_ASIO_ChannelEnableBASS(FALSE, 0, mixer, TRUE); // set the first two output channels to use it

See also

BASS_ASIO_ChannelEnable, BASS_ASIO_ChannelIsActive, BASS_ASIO_ChannelJoin, BASS_ASIO_ChannelReset, BASS_ASIO_ChannelSetVolume, BASS_ASIO_Start