Home > Mobile >  Cannot find name 'AudioDecoder'
Cannot find name 'AudioDecoder'

Time:07-30

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: () => {},
});

CodePudding user response:

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

  • Related