← Back to release summary

WebAudio: decodeAudioData detaches ArrayBuffer

Category
Multimedia
Type
New or changed feature
Status
Enabled by default (Chrome 59)
Intent stage
None

Summary

According to the spec, decodeAudioData detaches the given ArrayBuffer before decoding. This means that the ArrayBuffer no longer has any contents and can't be reused or examined. If it's important to keep the data, user ArrayBuffer.slice(0) to make a copy for decodeAudioData.

Standards & signals

Docs: https://webaudio.github.io/web-audio-api/#widl-BaseAudioContext-decodeAudioData-Promise-AudioBuffer--ArrayBuffer-audioData-DecodeSuccessCallback-successCallback-DecodeErrorCallback-errorCallback

View on chromestatus.com