Table of Contents

Struct CaptureBufferLease

Namespace
NAudio.CoreAudioApi
Assembly
NAudio.Wasapi.dll

Provides zero-copy read access to a WASAPI capture buffer. The buffer pointer is only valid until Dispose/Release is called. Must be used with using to ensure ReleaseBuffer is called.

public ref struct CaptureBufferLease
Inherited Members

Properties

Buffer

A read-only span over the captured audio data.

public readonly ReadOnlySpan<byte> Buffer { get; }

Property Value

ReadOnlySpan<byte>

DevicePosition

The device position (in frames) at the time of capture.

public readonly long DevicePosition { get; }

Property Value

long

Flags

Buffer flags indicating the state of the captured data (e.g. silent).

public readonly AudioClientBufferFlags Flags { get; }

Property Value

AudioClientBufferFlags

FrameCount

The number of frames in this buffer.

public int FrameCount { get; }

Property Value

int

QPCPosition

The QPC (QueryPerformanceCounter) position at the time of capture, in 100-nanosecond units.

public readonly long QPCPosition { get; }

Property Value

long

Methods

Dispose()

Releases the buffer back to WASAPI.

public void Dispose()

Release()

Releases the buffer back to WASAPI.

public void Release()