AsioDriverExt is a simplified version of the AsioDriver. It provides an easier way to access the capabilities of the Driver and implement the callbacks necessary for feeding the driver. Implementation inspired from Rob Philpot's with a managed C++ ASIO wrapper BlueWave.Interop.Asio http://www.codeproject.com/KB/mcpp/Asio.Net.aspx.
More...
|
void | BuildCapabilities () |
| Builds the capabilities of the ASIO driver, including driver name, input/output channels, channel information, sample rate, latencies, and buffer size.
|
|
void | BufferSwitchCallBack (int doubleBufferIndex, bool directProcess) |
| Callback function for switching buffers and invoking the fill buffer callback.
|
|
void | SampleRateDidChangeCallBack (double sRate) |
| Updates the sample rate in the capability and modifies the original array in place.
|
|
int | AsioMessageCallBack (AsioMessageSelector selector, int value, IntPtr message, IntPtr opt) |
| Handles ASIO messages and performs corresponding actions based on the message selector and value.
|
|
IntPtr | BufferSwitchTimeInfoCallBack (IntPtr asioTimeParam, int doubleBufferIndex, bool directProcess) |
| Callback function for switching buffer time information.
|
|
AsioDriverExt is a simplified version of the AsioDriver. It provides an easier way to access the capabilities of the Driver and implement the callbacks necessary for feeding the driver. Implementation inspired from Rob Philpot's with a managed C++ ASIO wrapper BlueWave.Interop.Asio http://www.codeproject.com/KB/mcpp/Asio.Net.aspx.
Contributor: Alexandre Mutel - email: alexandre_mutel at yahoo.fr
◆ AsioDriverExt()
NAudio.Wave.Asio.AsioDriverExt.AsioDriverExt |
( |
AsioDriver | driver | ) |
|
|
inline |
Initializes a new instance of the AsioDriverExt class based on an already instantiated AsioDriver instance.
- Parameters
-
driver | A AsioDriver already instantiated. |
◆ AsioMessageCallBack()
int NAudio.Wave.Asio.AsioDriverExt.AsioMessageCallBack |
( |
AsioMessageSelector | selector, |
|
|
int | value, |
|
|
IntPtr | message, |
|
|
IntPtr | opt ) |
|
inlineprivate |
Handles ASIO messages and performs corresponding actions based on the message selector and value.
- Parameters
-
selector | The ASIO message selector. |
value | The value associated with the message selector. |
message | A pointer to the message data. |
opt | A pointer to optional data. |
- Returns
- The result of the ASIO message handling.
This method handles ASIO messages and performs corresponding actions based on the message selector and value. It switches between different message selectors and executes the appropriate actions for each case. If the message selector is kAsioSelectorSupported, it further switches between sub-values to handle specific cases. The method also invokes the ResetRequestCallback when the message selector is kAsioResetRequest.
◆ BufferSwitchCallBack()
void NAudio.Wave.Asio.AsioDriverExt.BufferSwitchCallBack |
( |
int | doubleBufferIndex, |
|
|
bool | directProcess ) |
|
inlineprivate |
Callback function for switching buffers and invoking the fill buffer callback.
- Parameters
-
doubleBufferIndex | The index of the double buffer. |
directProcess | A boolean value indicating whether to process directly. |
◆ BufferSwitchTimeInfoCallBack()
IntPtr NAudio.Wave.Asio.AsioDriverExt.BufferSwitchTimeInfoCallBack |
( |
IntPtr | asioTimeParam, |
|
|
int | doubleBufferIndex, |
|
|
bool | directProcess ) |
|
inlineprivate |
Callback function for switching buffer time information.
- Parameters
-
asioTimeParam | The time parameter for the ASIO driver. |
doubleBufferIndex | The index of the double buffer. |
directProcess | A boolean value indicating whether the process is direct. |
- Returns
- Returns a pointer to the buffer switch time information.
◆ BuildCapabilities()
void NAudio.Wave.Asio.AsioDriverExt.BuildCapabilities |
( |
| ) |
|
|
inlineprivate |
Builds the capabilities of the ASIO driver, including driver name, input/output channels, channel information, sample rate, latencies, and buffer size.
This method initializes the capability object with the capabilities of the ASIO driver. It retrieves the driver name using AsioDriver.GetDriverName and the number of input/output channels using AsioDriver.GetChannels. It then retrieves the channel information for inputs and outputs using AsioDriver.GetChannelInfo. The sample rate is obtained using AsioDriver.GetSampleRate, and latencies are retrieved using AsioDriver.GetLatencies. If an error occurs during the retrieval of latencies, an AsioException is thrown with the specific error information. Finally, the buffer size is obtained using AsioDriver.GetBufferSize.
- Exceptions
-
AsioException | Thrown when an error occurs during the retrieval of latencies. |
◆ CreateBuffers()
int NAudio.Wave.Asio.AsioDriverExt.CreateBuffers |
( |
int | numberOfOutputChannels, |
|
|
int | numberOfInputChannels, |
|
|
bool | useMaxBufferSize ) |
|
inline |
Creates buffers for the specified number of output and input channels and returns the buffer size used.
- Parameters
-
numberOfOutputChannels | The number of output channels for which buffers need to be created. |
numberOfInputChannels | The number of input channels for which buffers need to be created. |
useMaxBufferSize | A boolean value indicating whether to use the maximum buffer size provided by the driver. |
- Exceptions
-
ArgumentException | Thrown when the number of output channels or input channels is invalid, i.e., not within the specified range. |
- Returns
- The size of the buffers created for the channels, based on whether the maximum buffer size provided by the driver is used or the preferred buffer size.
This method creates buffers for the specified number of output and input channels. It sets the number of output and input channels and initializes buffer information accordingly. If useMaxBufferSize is true, the driver's maximum buffer size is used; otherwise, the preferred buffer size is used. The ASIO Buffers are created with the specified buffer information and callbacks, and the method checks if outputReady is supported by the driver.
◆ IsSampleRateSupported()
bool NAudio.Wave.Asio.AsioDriverExt.IsSampleRateSupported |
( |
double | sampleRate | ) |
|
|
inline |
Checks if the specified sample rate is supported by the driver.
- Parameters
-
sampleRate | The sample rate to be checked. |
- Returns
- True if the sample rate is supported; otherwise, false.
◆ ReleaseDriver()
void NAudio.Wave.Asio.AsioDriverExt.ReleaseDriver |
( |
| ) |
|
|
inline |
Releases the driver resources and COM ASIO driver.
This method releases the driver resources by disposing the buffers and releasing the COM ASIO driver.
- Exceptions
-
Exception | Thrown if an error occurs while disposing the buffers. |
◆ SampleRateDidChangeCallBack()
void NAudio.Wave.Asio.AsioDriverExt.SampleRateDidChangeCallBack |
( |
double | sRate | ) |
|
|
inlineprivate |
Updates the sample rate in the capability and modifies the original array in place.
- Parameters
-
sRate | The new sample rate value. |
This method updates the sample rate in the capability object with the provided sRate value.
◆ SetChannelOffset()
void NAudio.Wave.Asio.AsioDriverExt.SetChannelOffset |
( |
int | outputChannelOffset, |
|
|
int | inputChannelOffset ) |
|
inline |
Sets the channel offsets for output and input channels.
- Parameters
-
outputChannelOffset | The offset for the output channels. |
inputChannelOffset | The offset for the input channels. |
- Exceptions
-
ArgumentException | Thrown when the sum of outputChannelOffset and numberOfOutputChannels is greater than the number of output channels in the capabilities. |
ArgumentException | Thrown when the sum of inputChannelOffset and numberOfInputChannels is greater than the number of input channels in the capabilities. |
◆ SetSampleRate()
void NAudio.Wave.Asio.AsioDriverExt.SetSampleRate |
( |
double | sampleRate | ) |
|
|
inline |
Sets the sample rate for the driver and updates the capabilities.
- Parameters
-
sampleRate | The new sample rate to be set. |
This method sets the sample rate for the driver to the specified value and then updates the capabilities by calling the BuildCapabilities method.
◆ ShowControlPanel()
void NAudio.Wave.Asio.AsioDriverExt.ShowControlPanel |
( |
| ) |
|
|
inline |
Shows the control panel by invoking the driver's ControlPanel method.
◆ Start()
void NAudio.Wave.Asio.AsioDriverExt.Start |
( |
| ) |
|
|
inline |
Starts the driver.
This method starts the driver, allowing it to perform its designated tasks.
◆ Stop()
void NAudio.Wave.Asio.AsioDriverExt.Stop |
( |
| ) |
|
|
inline |
◆ bufferInfos
AsioBufferInfo [] NAudio.Wave.Asio.AsioDriverExt.bufferInfos |
|
private |
◆ bufferSize
int NAudio.Wave.Asio.AsioDriverExt.bufferSize |
|
private |
◆ callbacks
◆ capability
◆ currentInputBuffers
IntPtr [] NAudio.Wave.Asio.AsioDriverExt.currentInputBuffers |
|
private |
◆ currentOutputBuffers
IntPtr [] NAudio.Wave.Asio.AsioDriverExt.currentOutputBuffers |
|
private |
◆ driver
readonly AsioDriver NAudio.Wave.Asio.AsioDriverExt.driver |
|
private |
◆ fillBufferCallback
◆ inputChannelOffset
int NAudio.Wave.Asio.AsioDriverExt.inputChannelOffset |
|
private |
◆ isOutputReadySupported
bool NAudio.Wave.Asio.AsioDriverExt.isOutputReadySupported |
|
private |
◆ numberOfInputChannels
int NAudio.Wave.Asio.AsioDriverExt.numberOfInputChannels |
|
private |
◆ numberOfOutputChannels
int NAudio.Wave.Asio.AsioDriverExt.numberOfOutputChannels |
|
private |
◆ outputChannelOffset
int NAudio.Wave.Asio.AsioDriverExt.outputChannelOffset |
|
private |
◆ ResetRequestCallback
Action NAudio.Wave.Asio.AsioDriverExt.ResetRequestCallback |
◆ Capabilities
Gets the capabilities of the AsioDriver.
The capabilities.
◆ Driver
Gets the driver used.
The ASIOdriver.
◆ FillBufferCallback
Gets or sets the fill buffer callback.
The fill buffer callback.
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Asio/ASIODriverExt.cs