Table of Contents

Method GetChannel16kSamples

Namespace
LMKit.Media.Audio
Assembly
LM-Kit.NET.dll

GetChannel16kSamples(int, CancellationToken)

Returns normalized samples for a single channel, resampled to 16 kHz if necessary.

public float[] GetChannel16kSamples(int channelIndex = 0, CancellationToken cancellationToken = default)

Parameters

channelIndex int

Zero-based index of the channel to extract.

cancellationToken CancellationToken

Token to cancel the read operation.

Returns

float[]

Array of floats representing the channel's normalized samples at 16 kHz.

Remarks

Unlike GetMono16kSamples(CancellationToken), this method always returns a new array since per-channel extraction cannot be cached.

Exceptions

ArgumentOutOfRangeException

Thrown if channelIndex is less than zero or greater than or equal to Channels.

OperationCanceledException

Thrown if the read is cancelled via cancellationToken.

CorruptedAudioException

Thrown if the WAV data chunk ends prematurely.