Function: pcmToMonoFloat32()
ts
function pcmToMonoFloat32(samples, channels): Float32Array;Convert an interleaved Int16 PCM block into a mono Float32 array in [-1, 1]. Pass the channel count from the onPcmChunk event.
For 2-channel input, this averages each L/R pair into a single mono sample, which is what most VAD / STT models expect.
Parameters
| Parameter | Type |
|---|---|
samples | Int16Array |
channels | number |
Returns
Float32Array