ExperimentalExperimental
The one-shot buffer from a sharedbufferreceived event.
Frees the page's view, usually chrome.webview.releaseBuffer.
PcmHeaderError when the buffer is not a one-shot PCM buffer this SDK can read.
Readonly Experimentalchannels1 when the request set mono.
Readonly Experimentaldurationframes / sampleRate, in seconds.
Readonly ExperimentalframesFrames per channel.
Readonly ExperimentalresampledConverted to sampleRate with foobar2000's resampler.
Readonly ExperimentalsampleSamples per second per channel.
Readonly ExperimentalstartTrack time of the first frame, in seconds.
Readonly ExperimentaltruncatedThe audio ran past the size estimated from the track length, or its format changed partway; the samples end at the cut.
Experimental
Zero-copy view of one channel, frames samples long.
Treat it as read-only: writing to it crashes the renderer process. It is
deliberately not called getChannelData, whose Web Audio namesake returns
an array you may modify. Views stop working after
PcmBuffer.release, or once the buffer handed out by
PcmBuffer.transfer has actually been transferred.
0-based channel index.
Experimental
Free the page's view of the shared memory. Safe to call more than once.
Experimental
Hand over the underlying ArrayBuffer, for example to
worker.postMessage(buffer, [buffer]).
After this call the object gives out no more views and
PcmBuffer.release does nothing. Views taken earlier keep working
until the buffer is actually transferred with postMessage; from then on
they are detached (byteLength 0). A transferred buffer can no longer be
released on this page; to free it early, transfer it back to the page and
pass it to chrome.webview.releaseBuffer. The header stays at the start
of the buffer, so the receiver can read it with readPcmHeader.
Samples of one
audio.decodePcmtask, backed by the shared buffer the host posted. Nothing is copied until you call PcmBuffer.toAudioBuffer.The memory is read-only: writing through a view from PcmBuffer.getChannelView crashes the page's renderer process, and with it the whole foobar2000 window. Call PcmBuffer.release when you are done so the shared memory can be reclaimed.