Skip to content
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
9 changes: 2 additions & 7 deletions src/audio_worklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function createWasmAudioWorkletProcessor(audioParams) {
assert(opts.callback)
assert(opts.samplesPerChannel)
#endif
this.callback = wasmTable.get(opts.callback);
this.callback = getWasmTableEntry(opts.callback);
this.userData = opts.userData;
// Then the samples per channel to process, fixed for the lifetime of the
// context that created this processor. Note for when moving to Web Audio
Expand Down Expand Up @@ -170,12 +170,7 @@ class BootstrapMessages extends AudioWorkletProcessor {
// conflict with user messages
messagePort.postMessage({'_wsc': d.callback, args: [d.contextHandle, 1/*EM_TRUE*/, d.userData] });
} else if (d['_wsc']) {
#if MEMORY64
var ptr = BigInt(d['_wsc']);
#else
var ptr = d['_wsc'];
#endif
wasmTable.get(ptr)(...d.args);
getWasmTableEntry(d['_wsc'])(...d.args);
};
}
}
Expand Down
1 change: 1 addition & 0 deletions src/lib/libwebaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ let LibraryWebAudio = {
}).catch(audioWorkletCreationFailed);
},

$_EmAudioDispatchProcessorCallback__deps: ['$getWasmTableEntry'],
$_EmAudioDispatchProcessorCallback: (e) => {
let data = e.data;
// '_wsc' is short for 'wasm call', trying to use an identifier name that
Expand Down
1 change: 1 addition & 0 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,7 @@ def limit_incoming_module_api():

if settings.AUDIO_WORKLET:
add_system_js_lib('libwebaudio.js')
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE.append('$getWasmTableEntry')

if not settings.MINIMAL_RUNTIME:
if 'preRun' in settings.INCOMING_MODULE_JS_API:
Expand Down