MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / constructor

Method constructor

src/audio_decoder.ts:57–69  ·  view source on GitHub ↗

* Creates a new AudioDecoder.

(init: AudioDecoderInit)

Source from the content-addressed store, hash-verified

55 * Creates a new AudioDecoder.
56 */
57 constructor(init: AudioDecoderInit) {
58 super();
59
60 if (!init.output || !init.error) {
61 throw new TypeError('AudioDecoderInit requires \'output\' and \'error\' callbacks.');
62 }
63
64 this.init = init;
65 this.frame = new Frame();
66 this.frame.alloc();
67 this.packet = new Packet();
68 this.packet.alloc();
69 }
70
71 private static createCodecContext(config: AudioDecoderConfig) {
72 const inferred = inferCodecFromCodecString(config.codec);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected