AudioDecoder: AudioDecoder() constructor - Web APIs | MDN

Syntax

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.

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.

js

const audioDecoder = new AudioDecoder({
  output: processAudio,
  error: onEncoderError,
});

Specifications

Specification
WebCodecs
# audiodecoder

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.