MCPcopy Create free account
hub / github.com/NVIDIA/personaplex / initDecoder

Function initDecoder

client/src/decoder/decoderWorker.ts:146–159  ·  view source on GitHub ↗
(worker: Worker, audioContextSampleRate: number)

Source from the content-addressed store, hash-verified

144
145// Initialize a decoder worker and return a promise that resolves when ready
146export const initDecoder = (worker: Worker, audioContextSampleRate: number): Promise<void> => {
147 return new Promise((resolve) => {
148 console.log("Starting decoder initialization");
149 lastWorkerError = null;
150
151 sendInitCommand(worker, audioContextSampleRate);
152
153 // Give worker time to load WASM and process init - 1000ms to be safe
154 setTimeout(() => {
155 console.log("Decoder initialization complete");
156 resolve();
157 }, 1000);
158 });
159};

Callers 1

setupWorkerFunction · 0.90

Calls 2

sendInitCommandFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected