Skip to content

Commit 5ab7f5e

Browse files
authored
Simplify AUDIO_WORKLET checks. NFC (#24164)
I assume the idea here was that there would be an AUDIO_WORKLET=2 mode but that was never added.
1 parent 279f298 commit 5ab7f5e

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

site/source/docs/api_reference/wasm_audio_worklets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ which resumes the audio context when the user clicks on the DOM Canvas element t
165165
return true; // Keep the graph output going
166166
}
167167
168-
And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET=1 -sWASM_WORKERS=1`` to enable targeting AudioWorklets.
168+
And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET -sWASM_WORKERS`` to enable targeting AudioWorklets.
169169

170170
Synchronizing audio thread with the main thread
171171
===============================================

src/audio_worklet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is the main bootstrap script for Wasm Audio Worklets loaded in an
2-
// Emscripten application. Build with -sAUDIO_WORKLET=1 linker flag to enable
2+
// Emscripten application. Build with -sAUDIO_WORKLET linker flag to enable
33
// targeting Audio Worklets.
44

55
// AudioWorkletGlobalScope does not have a onmessage/postMessage() functionality

src/settings_internal.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ var WASM_BINARY_FILE = '';
137137
// name of the file containing the Wasm Worker *.ww.js, if relevant
138138
var WASM_WORKER_FILE = '';
139139

140-
// name of the file containing the Audio Worklet *.aw.js, if relevant
141-
var AUDIO_WORKLET_FILE = '';
142-
143140
// Base URL the source mapfile, if relevant
144141
var SOURCE_MAP_BASE = '';
145142

tools/link.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,6 @@ def limit_incoming_module_api():
14211421
default_setting('WASM_BIGINT', feature_matrix.caniuse(feature_matrix.Feature.JS_BIGINT_INTEGRATION))
14221422

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

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

21842183
if settings.MODULARIZE and settings.MODULARIZE != 'instance':
21852184
modularize()

0 commit comments

Comments
 (0)