()
| 38 | |
| 39 | // Factory function to create a decoder worker with error tracking |
| 40 | const createWorkerWithErrorTracking = (): Worker => { |
| 41 | const worker = new Worker( |
| 42 | new URL("/assets/decoderWorker.min.js", import.meta.url), |
| 43 | ); |
| 44 | |
| 45 | // Track errors from the worker |
| 46 | worker.onerror = (event) => { |
| 47 | console.error("Decoder worker error:", event.message); |
| 48 | lastWorkerError = new Error(event.message); |
| 49 | }; |
| 50 | |
| 51 | return worker; |
| 52 | }; |
| 53 | |
| 54 | // Send init command to a worker, then send warmup BOS page |
| 55 | const sendInitCommand = (worker: Worker, audioContextSampleRate: number): void => { |
no outgoing calls
no test coverage detected