WebCodecs APIwindow_and_dedicated
The AudioDecoder() constructor creates a new AudioDecoder object with the provided init.output callback assigned as the output callback, the provided init.error callback as the error callback, and the AudioDecoder.state set to "unconfigured".
Syntax
new AudioDecoder(init)
Parameters
init- : A dictionary object containing two required callbacks.
output- : A callback which is passed a single argument of an AudioData object.
error- : A callback which is passed a single argument of the error that has been thrown.
- : A dictionary object containing two required callbacks.
Examples
In the following example an AudioDecoder is created with the two required callback functions, one to deal with the decoded chunk and the other to handle errors.
const audioDecoder = new AudioDecoder({
output: processAudio,
error: onEncoderError,
});
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
