Table of Contents

Class AsioNativeToFloatConverter

Namespace
NAudio.Wave.Asio
Assembly
NAudio.Asio.dll

Converts a single channel of native ASIO samples into a Span<T> of normalized floats in [-1.0, +1.0]. Supported native formats are Int16LSB, Int24LSB, Int32LSB, and Float32LSB — the four formats used by the vast majority of ASIO drivers. Other formats throw NotSupportedException.

public static class AsioNativeToFloatConverter
Inheritance
AsioNativeToFloatConverter
Inherited Members

Remarks

This is exposed publicly so callers using the raw-buffer escape hatch on AsioDevice (RawInput/RawOutput) can convert bytes to float without re-implementing the per-format math.

Methods

BytesPerSample(AsioSampleType)

Bytes per sample for the given native format. Throws for unsupported formats.

public static int BytesPerSample(AsioSampleType nativeFormat)

Parameters

nativeFormat AsioSampleType

Returns

int

Select(AsioSampleType)

Returns a converter for the given native ASIO sample type, or throws NotSupportedException if the format is not supported by the new AsioDevice API.

public static AsioNativeToFloatConverter.ConverterFn Select(AsioSampleType nativeFormat)

Parameters

nativeFormat AsioSampleType

Returns

AsioNativeToFloatConverter.ConverterFn