BASS.NET API for the Un4seen BASS Audio LibraryBassAsioHandlerSetFullDuplex Method (Int32, BASSFlag, Boolean)BASS.NET API for the Un4seen BASS Audio Library
Sets the full-duplex option for ASIO input using the given BASS output device.

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

public bool SetFullDuplex(
	int bassDevice,
	BASSFlag flags,
	bool buffered
)

Parameters

bassDevice
Type: SystemInt32
The BASS output device which should be used for full-duplex monitoring.
flags
Type: Un4seen.BassBASSFlag
The optional BASSFlag flags to be used to create the full-duplex monitoring OutputChannel. Typically only the following flags should be used: BASS_STREAM_DECODE, BASS_SAMPLE_SOFTWARE or BASS_SPEAKER_xxx.
buffered
Type: SystemBoolean
, if the OutputChannel should be (pre)buffered - else .

Prebuffering of sample data is often requied for buffered output to enable a constant playback. So even if you are using a BASS_STREAM_DECODE flag you might need to prebuffer it's data.

Return Value

Type: Boolean
On success is returned, else will be returned (use BASS_ASIO_ErrorGetCode to retrieve the error code).
Remarks

The following will be done internally:

1. The ASIO input Channel will be used (and enabled and joined, only if not enabled yet).

2. The BASS output bassDevice will be used.

3. A custom push stream (see OutputChannel) will be created (using the given flags) with an internal ASIO callback feeding the stream with the sample data from the input.

4. The samplerate, format and number of channels will not be changed for ASIO input, since this will be used as already specified in the constructor.

5. The custom push stream will be started playing (via BASS_ChannelPlay(Int32, Boolean)) - unless the BASS_STREAM_DECODE flag has been specified.

This method can not be used with ASIO output (see IsInput). It will immediately return with no effect.

To disable and remove the full-duplex option call RemoveFullDuplex(Boolean).

The full-duplex BASS output is provided by the internal custom push stream OutputChannel. You might use this stream to set up DSPs or FX on it so that these are applied on the BASS output.

You might bypass any full-duplex output procesing by setting the BypassFullDuplex property to .

You might use the 0 (no-sound) bass device together with the BASS_STREAM_DECODE flag in order to create a custom decoding OutputChannel which might for example be used with an BaseEncoder or WaveWriter or as a source for a mixer channel.

Examples

Automatic use of the BassAsioHandler (Asio recording input, full-duplex to BASS):
VB
Private _asio As BassAsioHandler
...
' assign ASIO input to the first device and channel (stereo, 32-bit float, 48kHz)
_asio = New BassAsioHandler(True, 0, 0, 2, BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT, 48000)
' set the full-duplex option to the first BASS output device using the rear speakers
' the BASS output format will always be the same as the ASIO input for full-duplex
_asio.SetFullDuplex(1, BASSFlag.BASS_SPEAKER_REAR, True)

' start ASIO
BassAsio.BASS_ASIO_Start(0)
_asio.ResetFullDuplex()

' setup an FX on the full-duplex BASS output
Dim echo As New BASS_FXECHO()
Dim fxHandle As Integer = Bass.BASS_ChannelSetFX(_asio.OutputChannel, BASSFXType.BASS_FX_ECHO, 0)
echo.Preset_Long()
' apply the effect parameters
Bass.BASS_FXSetParameters(fxHandle, echo)
private BassAsioHandler _asio;
...
// assign ASIO input to the first device and channel (stereo, 32-bit float, 48kHz)
_asio = new BassAsioHandler(true, 0, 0, 2, BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT, 48000);
// set the full-duplex option to the first BASS output device using the rear speakers
// the BASS output format will always be the same as the ASIO input for full-duplex
_asio.SetFullDuplex(1, BASSFlag.BASS_SPEAKER_REAR, true);

// start ASIO
BassAsio.BASS_ASIO_Start(0);
_asio.ResetFullDuplex();

// setup an FX on the full-duplex BASS output
BASS_FXECHO echo = new BASS_FXECHO();
int fxHandle = Bass.BASS_ChannelSetFX(_asio.OutputChannel, BASSFXType.BASS_FX_ECHO, 0);
echo.Preset_Long();
// apply the effect parameters
Bass.BASS_FXSetParameters(fxHandle, echo);
See Also

Reference