Skip to content

Commit 56f221e

Browse files
authored
Distinguish node handle from audio handle
1 parent 1092ec3 commit 56f221e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

system/include/emscripten/webaudio.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern "C" {
1818
#endif
1919

2020
typedef int EMSCRIPTEN_WEBAUDIO_T;
21+
typedef int EMSCRIPTEN_AUDIO_WORKLET_NODE_T;
2122

2223
typedef struct EmscriptenWebAudioCreateAttributes
2324
{
@@ -57,7 +58,7 @@ void emscripten_destroy_audio_context(EMSCRIPTEN_WEBAUDIO_T audioContext);
5758
// Disconnects the given audio node from its audio graph, and then releases
5859
// the JS object table reference to the given audio node. The specified handle
5960
// is invalid after calling this function.
60-
void emscripten_destroy_web_audio_node(EMSCRIPTEN_WEBAUDIO_T objectHandle);
61+
void emscripten_destroy_web_audio_node(EMSCRIPTEN_AUDIO_WORKLET_NODE_T objectHandle);
6162

6263
// Create Wasm AudioWorklet thread. Call this function once at application startup to establish an AudioWorkletGlobalScope for your app.
6364
// After the scope has been initialized, the given callback will fire.
@@ -99,8 +100,6 @@ void emscripten_create_wasm_audio_worklet_processor_async(EMSCRIPTEN_WEBAUDIO_T
99100
// For this to change from the default 128, the context would need to be created with a yet unexposed WebAudioWorkletProcessorCreateOptions renderSizeHint, part of the 1.1 Web Audio API.
100101
int emscripten_audio_context_quantum_size(EMSCRIPTEN_WEBAUDIO_T audioContext);
101102

102-
typedef int EMSCRIPTEN_AUDIO_WORKLET_NODE_T;
103-
104103
typedef struct AudioSampleFrame
105104
{
106105
// Number of audio channels to process (multiplied by samplesPerChannel gives the elements in data)
@@ -139,7 +138,7 @@ EMSCRIPTEN_AUDIO_WORKLET_NODE_T emscripten_create_wasm_audio_worklet_node(EMSCRI
139138

140139
// Connects a node's output to a target, e.g., connect the worklet node to the context.
141140
// For outputIndex and inputIndex, see the AudioNode.connect() documentation (setting 0 as the default values)
142-
void emscripten_audio_node_connect(EMSCRIPTEN_WEBAUDIO_T source, EMSCRIPTEN_WEBAUDIO_T destination, int outputIndex, int inputIndex);
141+
void emscripten_audio_node_connect(EMSCRIPTEN_AUDIO_WORKLET_NODE_T source, EMSCRIPTEN_WEBAUDIO_T destination, int outputIndex, int inputIndex);
143142

144143
// Returns true if the current thread is executing a Wasm AudioWorklet, false otherwise.
145144
// Note that calling this function can be relatively slow as it incurs a Wasm->JS transition,

0 commit comments

Comments
 (0)