Skip to main content
Version: 14 Oct 2024

Buffer

An audio buffer for passing data from input streams or to output streams.

Public Methods

Buffer

public Buffer(
BufferFormat format,
float [] samples
)

Parameters

TypeNameDescription
BufferFormatformatBuffer format settings for input and output streams.
float []samples

float [] ConvertToManagedFloatSamples

Copy the provided unmanaged audio buffer to managed memory and convert the samples to float.

public static float [] ConvertToManagedFloatSamples(
uint size,
IntPtr bufferPtr,
BufferFormat format
)

Parameters

TypeNameDescription
uintsizeNumber of bytes allocated for the unmanaged buffer
IntPtrbufferPtrPointer to the unmanaged buffer
BufferFormatformatAudio format for the unmanaged buffer

Returns: Array of managed memory containing float samples


Public Attributes

Format

Audio buffer format.


public BufferFormat Format;

TypeDescription
BufferFormatBuffer format settings for input and output streams.

NativeDataPtr

Pointer to audio data. Only valid when received on native callback threads.


public IntPtr NativeDataPtr;


Samples

Audio samples in this buffer.


public float [] Samples;


Size

Size of audio data in bytes. Only valid when received on native callback threads.


public uint Size;