Create an empty audio buffer or deep-copy an existing buffer.
sourceOptionalCopy interleaved 16-bit PCM; sample rate is in Hz and channelMap specifies each channel's position.
sampleschannelCountsampleRatechannelMapCopy the current source data synchronously, retaining this buffer's identity.
sourceReturn the number of channels.
Return a read-only view of channel positions in interleaved order.
Return the total sample count across all channels.
Return the sample rate per channel, in Hz.
Return a read-only typed PCM view, or undefined for an empty buffer. After reloading, existing views still reference the old storage.
Asynchronously decode an entire audio file into native PCM storage, returning whether it succeeded.
filenameAsynchronously decode encoded audio bytes and replace the PCM, returning whether it succeeded.
dataSynchronously copy interleaved 16-bit PCM and replace the contents; sampleRate is in Hz. Return whether it succeeded.
datachannelCountsampleRatechannelMapAsynchronously decode all samples from an input stream, returning whether it succeeded; stream errors reject the Promise.
streamAsynchronously encode and save using the file extension to select the format, returning whether it succeeded.
filename
Views retain the exact native allocation from which they were obtained.