BASS.NET API for the Un4seen BASS Audio Library

BassAsioBASS_ASIO_ChannelEnableBASS Method

BASS.NET API for the Un4seen BASS Audio Library
Enables a channel, and sets it to use a BASS channel.

Namespace:  Un4seen.BassAsio
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

[DllImportAttribute("bassasio")]
public static bool BASS_ASIO_ChannelEnableBASS(
	bool input,
	int channel,
	int handle,
	bool join
)

Parameters

input
Type: SystemBoolean
Dealing with an input channel? = an output channel.
channel
Type: SystemInt32
The input/output channel number... 0 = first.
handle
Type: SystemInt32
The BASS channel handle.
join
Type: SystemBoolean
Join the next ASIO channels according to the number of audio channels in the BASS channel?

Return Value

Type: Boolean
If succesful, then is returned, else is returned. Use BASS_ASIO_ErrorGetCode to get the error code.
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(Boolean, Int32, Int32). 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' stream, created with BASS_StreamCreatePush(Int32, Int32, BASSFlag, IntPtr), which will receive the data from the input channel(s).

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(Boolean). 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(Double).

ERROR CODEDescription
BASS_ERROR_INITBASS_ASIO_Init(Int32, BASSASIOInit) has not been successfully called.
BASS_ERROR_NOTAVAILThe BASS library is not loaded.
BASS_ERROR_STARTThe device has been started - it needs to be stopped before (dis)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.

See Also

Reference