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
2 changes: 1 addition & 1 deletion site/source/docs/api_reference/wasm_audio_worklets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ which resumes the audio context when the user clicks on the DOM Canvas element t
return true; // Keep the graph output going
}

And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET=1 -sWASM_WORKERS=1`` to enable targeting AudioWorklets.
And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET -sWASM_WORKERS`` to enable targeting AudioWorklets.

Synchronizing audio thread with the main thread
===============================================
Expand Down
2 changes: 1 addition & 1 deletion src/audio_worklet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is the main bootstrap script for Wasm Audio Worklets loaded in an
// Emscripten application. Build with -sAUDIO_WORKLET=1 linker flag to enable
// Emscripten application. Build with -sAUDIO_WORKLET linker flag to enable
// targeting Audio Worklets.

// AudioWorkletGlobalScope does not have a onmessage/postMessage() functionality
Expand Down
3 changes: 0 additions & 3 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ var WASM_BINARY_FILE = '';
// name of the file containing the Wasm Worker *.ww.js, if relevant
var WASM_WORKER_FILE = '';

// name of the file containing the Audio Worklet *.aw.js, if relevant
var AUDIO_WORKLET_FILE = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a separate change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, its just an internal setting that is no longer needed after this change.


// Base URL the source mapfile, if relevant
var SOURCE_MAP_BASE = '';

Expand Down
7 changes: 3 additions & 4 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,8 +1421,6 @@ def limit_incoming_module_api():
default_setting('WASM_BIGINT', feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION))

if settings.AUDIO_WORKLET:
if settings.AUDIO_WORKLET == 1:
settings.AUDIO_WORKLET_FILE = unsuffixed(os.path.basename(target)) + '.aw.js'
add_system_js_lib('libwebaudio.js')
if not settings.MINIMAL_RUNTIME:
# If we are in the audio worklet environment, we can only access the Module object
Expand Down Expand Up @@ -2178,8 +2176,9 @@ def phase_final_emitting(options, target, js_target, wasm_target):
create_worker_file('src/wasm_worker.js', target_dir, settings.WASM_WORKER_FILE, options)

# Deploy the Audio Worklet module bootstrap file (*.aw.js)
if settings.AUDIO_WORKLET == 1:
create_worker_file('src/audio_worklet.js', target_dir, settings.AUDIO_WORKLET_FILE, options)
if settings.AUDIO_WORKLET:
audio_worklet_file = unsuffixed_basename(js_target) + '.aw.js'
create_worker_file('src/audio_worklet.js', target_dir, audio_worklet_file, options)

if settings.MODULARIZE and settings.MODULARIZE != 'instance':
modularize()
Expand Down