Skip to content

Function: decodePcmChunk() ​

ts
function decodePcmChunk(chunkBase64): Int16Array;

Decode the base64 chunk payload from an onPcmChunk event into an Int16Array (one entry per interleaved sample-per-channel).

Uses globalThis.atob when the runtime provides it and a built-in decoder otherwise, so there is no third-party dependency.

Parameters ​

ParameterType
chunkBase64string

Returns ​

Int16Array

Released under the MIT License.