Table of Contents

Class WasapiPlaybackCapability

Namespace
NAudio.Wave
Assembly
NAudio.Wasapi.dll

Describes what Init(IWaveProvider) would do for a particular source format, as returned by GetPlaybackCapability(WaveFormat). Lets you validate a chosen configuration before opening the audio stream.

public sealed record WasapiPlaybackCapability : IEquatable<WasapiPlaybackCapability>
Inheritance
WasapiPlaybackCapability
Implements
Inherited Members

Constructors

WasapiPlaybackCapability(bool, AudioClientShareMode, bool, WaveFormat, IReadOnlyList<string>, int, string)

Describes what Init(IWaveProvider) would do for a particular source format, as returned by GetPlaybackCapability(WaveFormat). Lets you validate a chosen configuration before opening the audio stream.

public WasapiPlaybackCapability(bool Supported, AudioClientShareMode ShareMode, bool LowLatencyActive, WaveFormat OutputFormat, IReadOnlyList<string> Conversions, int LatencyMilliseconds, string Reason)

Parameters

Supported bool

Whether playback is possible at all. False only in exclusive mode when the device cannot accept the source's sample rate (which would require resampling); shared mode is always supported.

ShareMode AudioClientShareMode

The share mode that would be used.

LowLatencyActive bool

Whether the IAudioClient3 low-latency path would actually engage. Only ever true when low latency was requested and the source can be adapted to the engine mix format without resampling.

OutputFormat WaveFormat

The format the device would receive (after any conversion).

Conversions IReadOnlyList<string>

Human-readable descriptions of the latency-free conversions that would be inserted (bit depth, channels), or empty when the source is used as-is. Note that in standard shared mode the audio engine performs conversion (including sample-rate) itself, so this list is empty there.

LatencyMilliseconds int

The latency that would be used, in milliseconds.

Reason string

When Supported is false, why playback is not possible. When low latency was requested but LowLatencyActive is false, why it could not be honoured. Null otherwise.

Properties

Conversions

Human-readable descriptions of the latency-free conversions that would be inserted (bit depth, channels), or empty when the source is used as-is. Note that in standard shared mode the audio engine performs conversion (including sample-rate) itself, so this list is empty there.

public IReadOnlyList<string> Conversions { get; init; }

Property Value

IReadOnlyList<string>

LatencyMilliseconds

The latency that would be used, in milliseconds.

public int LatencyMilliseconds { get; init; }

Property Value

int

LowLatencyActive

Whether the IAudioClient3 low-latency path would actually engage. Only ever true when low latency was requested and the source can be adapted to the engine mix format without resampling.

public bool LowLatencyActive { get; init; }

Property Value

bool

OutputFormat

The format the device would receive (after any conversion).

public WaveFormat OutputFormat { get; init; }

Property Value

WaveFormat

Reason

When Supported is false, why playback is not possible. When low latency was requested but LowLatencyActive is false, why it could not be honoured. Null otherwise.

public string Reason { get; init; }

Property Value

string

ShareMode

The share mode that would be used.

public AudioClientShareMode ShareMode { get; init; }

Property Value

AudioClientShareMode

Supported

Whether playback is possible at all. False only in exclusive mode when the device cannot accept the source's sample rate (which would require resampling); shared mode is always supported.

public bool Supported { get; init; }

Property Value

bool