diff --git a/src/audio_worklet.js b/src/audio_worklet.js index e57792885ede7..985f69d2ca083 100644 --- a/src/audio_worklet.js +++ b/src/audio_worklet.js @@ -150,7 +150,7 @@ class BootstrapMessages extends AudioWorkletProcessor { // scope to create the real AudioWorkletProcessors that call out to Wasm to // do audio processing. let p = globalThis['messagePort'] = this.port; - p.onmessage = (msg) => { + p.onmessage = async (msg) => { let d = msg.data; if (d['_wpn']) { // '_wpn' is short for 'Worklet Processor Node', using an identifier @@ -161,7 +161,7 @@ class BootstrapMessages extends AudioWorkletProcessor { // MODULARIZE+AUDIO_WORKLET builds. if (globalThis.AudioWorkletModule) { // This populates the Module object with all the Wasm properties - AudioWorkletModule(Module); + globalThis.Module = await AudioWorkletModule(Module); // We have now instantiated the Module function, can discard it from // global scope delete globalThis.AudioWorkletModule;