Skip to content

Commit 3c4c631

Browse files
committed
Avoid calling addEventListener in audio worklet
1 parent fa80cf2 commit 3c4c631

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/library_wasm_worker.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ addToLibrary({
145145
_emscripten_create_wasm_worker__postset: `
146146
if (ENVIRONMENT_IS_WASM_WORKER) {
147147
_wasmWorkers[0] = this;
148-
addEventListener("message", _wasmWorkerAppendToQueue);
148+
if (typeof AudioWorkletGlobalScope === 'undefined') {
149+
addEventListener("message", _wasmWorkerAppendToQueue);
150+
}
149151
}`,
150152
_emscripten_create_wasm_worker: (stackLowestAddress, stackSize) => {
151153
let worker = _wasmWorkers[_wasmWorkersID] = new Worker(

0 commit comments

Comments
 (0)