1

I am writing a react program with ts, using vscode 1.69.2, node 16.15.1.

I am trying to construct a new AudioDecoder object, but it throws an error "Cannot find name 'AudioDecoder'", while the WebCodecs api, and with it the AudioDecoder should be natively available for use.

what am I doing wrong?

const audioDecoder = new AudioDecoder({
  output: () => {},
  error: () => {},
});
DanilaBou
  • 25
  • 4

1 Answers1

1

As the WebCodecs are a new API (they're not fully supported by Firefox & Safari) they're not integrated into Typescript's libdom yet.

You will need to install @types/dom-webcodecs

Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134