Skip to content

Commit

Permalink
Fix AUDIO_WORKLET + MODULARIZE
Browse files Browse the repository at this point in the history
The change that was made back in emscripten-core#21775 means that its no longer OK to
ignore the return value of the `MODULARIZE` constructor function.

Fixes: emscripten-core#21908
  • Loading branch information
sbc100 committed May 17, 2024
1 parent 9ac0425 commit fd3daca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/audio_worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit fd3daca

Please sign in to comment.