Method GetChannel16kSamples
GetChannel16kSamples(int, CancellationToken)
Reads and returns normalized samples for a single channel, and resamples to 16 kHz if necessary.
public float[] GetChannel16kSamples(int channelIndex = 0, CancellationToken cancellationToken = default)
Parameters
channelIndex
intZero-based index of the channel to extract.
cancellationToken
CancellationTokenToken to cancel the read operation.
Returns
- float[]
Array of floats representing the channel's normalized samples at 16 kHz.
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.