encodeInts16

encodeInts16: (audio: AudioData | AudioBufferLike, maxLength?: int) => ArrayBuffer

Encode the audio as a 16-bit PCM WAV file. Float samples are clamped to [-1, 1] and scaled to int16. Same input shape as encodeFloats (AudioData or AudioBufferLike); output is a complete RIFF/WAVE ArrayBuffer ready to drop into a Blob or pass to importers expecting standard 16-bit WAV.

Type

(audio: AudioData | AudioBufferLike, maxLength?: int) => ArrayBuffer