BASS.NET API for the Un4seen BASS Audio LibraryBassAsioHandlerAsioToAsioFullDuplexCallback Method BASS.NET API for the Un4seen BASS Audio Library
Provides a ready made ASIOPROC callback procedure which might be used for full-duplex ASIO input to Asio output.

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

public virtual int AsioToAsioFullDuplexCallback(
	bool input,
	int channel,
	IntPtr buffer,
	int length,
	IntPtr user
)

Parameters

input
Type: SystemBoolean
Dealing with an input channel? = an output channel, = an input channel (both input and output must be supported by this callback).
channel
Type: SystemInt32
The input/output channel number... 0 = first.
buffer
Type: SystemIntPtr
The pointer to the buffer containing the recorded data (if input), or in which to put the data to output (if output).
length
Type: SystemInt32
The number of BYTES to process.
user
Type: SystemIntPtr
Not used.

Return Value

Type: Int32
The number of bytes written (if output), else 0 (if input).
Remarks

To apply DSP/FX independetly to the input and output you might use the InputChannel and OutputChannel respectively.

If you intend to overload this callback in a derive implementation make sure to call the base method to not loose any functionatily.

Examples

Implementing your own callback in a derived implementation:
VB
Public Class MyAsioHandler 
  Inherits BassAsioHandler

  Public Overrides Function AsioToAsioFullDuplexCallback(input As Boolean, channel As Integer, buffer As IntPtr, length As Integer, user As IntPtr) As Integer
    ' FullDuplex not applied yet
    If input Then
      ' do your own input stuff here...
    Else
      ' do your own output stuff here...
    End If
    Dim len As Integer = MyBase.AsioToAsioFullDuplexCallback(input, channel, buffer, length, user)
    ' FullDuplex already applied
    If input Then
      ' do your own input stuff here...
    Else
      ' do your own output stuff here...
    End If
    Return len
  End Function

End Class
public class MyAsioHandler : BassAsioHandler
{

  public override int AsioToAsioFullDuplexCallback(bool input, int channel, IntPtr buffer, int length, IntPtr user)
  {
    // FullDuplex not applied yet
    if (input)
    {
      // do your own input stuff here...
    }
    else
    {
      // do your own output stuff here...
    }
    int len = base.AsioToAsioFullDuplexCallback(input, channel, buffer, length, user);
    // FullDuplex already applied
    if (input)
    {
      // do your own input stuff here...
    }
    else
    {
      // do your own output stuff here...
    }
    return len;
  }

}
See Also

Reference