MCPcopy Create free account
hub / github.com/akdeb/ElatoAI / getEncoderFactory

Function getEncoderFactory

server/cloudflare/src/opus.ts:133–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131let encoderFactoryPromise: Promise<() => WasmOpusEncoder> | undefined;
132
133async function getEncoderFactory(): Promise<() => WasmOpusEncoder> {
134 if (!encoderFactoryPromise) {
135 encoderFactoryPromise = wasmInstancePromise.then((instance) => {
136 const wasm = instance.exports as unknown as OpusExports;
137 return () => new WasmOpusEncoder(wasm);
138 });
139 }
140
141 return encoderFactoryPromise;
142}
143
144function concatBytes(left: Uint8Array, right: Uint8Array): Uint8Array {
145 const out = new Uint8Array(left.length + right.length);

Callers 1

createOpusPacketizerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected