Webaudio: Consistent use of node handle vs audio handle #23153
+3
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's currently some confusion in webaudio.h about node handle types vs the audio handle type -
EMSCRIPTEN_WEBAUDIO_T
is sometimes used to refer to nodes, where it should beEMSCRIPTEN_AUDIO_WORKLET_NODE_T
.emscripten_create_wasm_audio_worklet_node
returnsEMSCRIPTEN_AUDIO_WORKLET_NODE_T
but functionsemscripten_destroy_web_audio_node
andemscripten_audio_node_connect
expect the node handle to be passed as aEMSCRIPTEN_WEBAUDIO_T
. This PR straightens out those inconsistencies.It presently doesn't make any material difference since both handles are
typedef int
, so this PR just makes things clearer without changing any behaviour. If the typedefs ever change in future, it will become important.Changes
EMSCRIPTEN_AUDIO_WORKLET_NODE_T
node handle typedef to the top of the file alongside theEMSCRIPTEN_WEBAUDIO_T
definition.emscripten_destroy_web_audio_node
accepts a node handle.emscripten_audio_node_connect
accepts a node handle as its first argument.