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

Method constructor

src/audio_encoder.ts:103–115  ·  view source on GitHub ↗

* Creates a new AudioEncoder.

(init: AudioEncoderInit)

Source from the content-addressed store, hash-verified

101 * Creates a new AudioEncoder.
102 */
103 constructor(init: AudioEncoderInit) {
104 super();
105
106 if (!init.output || !init.error) {
107 throw new TypeError('AudioEncoderInit requires \'output\' and \'error\' callbacks.');
108 }
109
110 this.init = init;
111 this.frame = new Frame();
112 this.frame.alloc();
113 this.packet = new Packet();
114 this.packet.alloc();
115 }
116
117 private static createCodecContext(config: AudioEncoderConfig) {
118 const inferred = inferCodecFromCodecString(config.codec);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected