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).
Parameters
Section titled “Parameters”audioData
Section titled “audioData”Float32Array<ArrayBufferLike>
Audio samples (mono)
sampleRate
Section titled “sampleRate”number
Sample rate
filename?
Section titled “filename?”string = 'audio.wav'
Output filename
format?
Section titled “format?”string = 'wav'
Audio format (‘wav’, ‘ogg’)
Returns
Section titled “Returns”Blob
The encoded WAV Blob (also offered as a download)