Skip to content

Fix audio worklet + memory64 #22731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/audio_worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ class BootstrapMessages extends AudioWorkletProcessor {
// initialize the Wasm Module.
globalThis.Module['instantiateWasm'] = (info, receiveInstance) => {
var instance = new WebAssembly.Instance(Module['wasm'], info);
receiveInstance(instance, Module['wasm']);
return instance.exports;
return receiveInstance(instance, Module['wasm']);
};
#endif
#if WEBAUDIO_DEBUG
Expand Down Expand Up @@ -184,7 +183,12 @@ class BootstrapMessages extends AudioWorkletProcessor {
// 'ud' the passed user data
p.postMessage({'_wsc': d['cb'], 'x': [d['ch'], 1/*EM_TRUE*/, d['ud']] });
} else if (d['_wsc']) {
Module['wasmTable'].get(d['_wsc'])(...d['x']);
#if MEMORY64
var ptr = BigInt(d['_wsc']);
#else
var ptr = d['_wsc'];
#endif
Module['wasmTable'].get(ptr)(...d['x']);
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,6 @@ def create_pointer_conversion_wrappers(metadata):
for f in wrap_functions:
sig = mapping[f]
wrappers += f"\n wasmExports['{f}'] = makeWrapper_{sig}(wasmExports['{f}']);"
wrappers += 'return wasmExports;\n}'
wrappers += '\n return wasmExports;\n}'

return wrappers
Loading