Skip to content

saveAudio

saveAudio(audioData, sampleRate, filename?, format?): Blob

Defined in: packages/pleco-xa/src/scripts/xa-file.js:390

Save audio data as downloadable file

Tier-2 proof-of-work repair (2026-07-02): the private _encodeWAV here was one of the three divergent encoders that src/io/wav.js explicitly replaced; saveAudio now delegates to io/wav.encodeWav and returns the Blob so callers can verify the roundtrip (proof: examples/web/file-io.html).

Float32Array<ArrayBufferLike>

Audio samples (mono)

number

Sample rate

string = 'audio.wav'

Output filename

string = 'wav'

Audio format (‘wav’, ‘ogg’)

Blob

The encoded WAV Blob (also offered as a download)