|
17 | 17 | extern "C" { |
18 | 18 | #endif |
19 | 19 |
|
| 20 | +// A handle type that represents a JavaScript side object related to WebAudio. |
| 21 | +// Used to denote the AudioContext and Audio Nodes, especially the Audio Worklet |
| 22 | +// Node. |
20 | 23 | typedef int EMSCRIPTEN_WEBAUDIO_T; |
21 | 24 |
|
| 25 | +// An outdated node type that represented an AudioWorklet node. |
| 26 | +// If you are using this type in your application, replace it with |
| 27 | +// EMSCRIPTEN_WEBAUDIO_T handle type instead. |
| 28 | +typedef int EMSCRIPTEN_AUDIO_WORKLET_NODE_T __attribute__((deprecated("use EMSCRIPTEN_WEBAUDIO_T instead"))); |
| 29 | + |
22 | 30 | // Default render size of 128 frames |
23 | 31 | #define AUDIO_CONTEXT_RENDER_SIZE_DEFAULT 0 |
24 | 32 | // Let the hardware determine the best render size |
@@ -108,8 +116,6 @@ int emscripten_audio_context_quantum_size(EMSCRIPTEN_WEBAUDIO_T audioContext); |
108 | 116 | // Returns the sampling rate of the given Audio Context, e.g. 48000 or 44100 or similar. |
109 | 117 | int emscripten_audio_context_sample_rate(EMSCRIPTEN_WEBAUDIO_T audioContext); |
110 | 118 |
|
111 | | -typedef int EMSCRIPTEN_AUDIO_WORKLET_NODE_T; |
112 | | - |
113 | 119 | typedef struct AudioSampleFrame |
114 | 120 | { |
115 | 121 | // Number of audio channels to process (multiplied by samplesPerChannel gives the elements in data) |
@@ -162,7 +168,8 @@ typedef struct EmscriptenAudioWorkletNodeCreateOptions |
162 | 168 |
|
163 | 169 | // Instantiates the given AudioWorkletProcessor as an AudioWorkletNode, which continuously calls the specified processCallback() function on the browser's audio thread to perform audio processing. |
164 | 170 | // userData4: A custom userdata pointer to pass to the callback function. This value will be passed on to the call to the given EmscriptenWorkletNodeProcessCallback callback function. |
165 | | -EMSCRIPTEN_AUDIO_WORKLET_NODE_T emscripten_create_wasm_audio_worklet_node(EMSCRIPTEN_WEBAUDIO_T audioContext, const char *name, const EmscriptenAudioWorkletNodeCreateOptions *options, EmscriptenWorkletNodeProcessCallback processCallback, void *userData4); |
| 171 | +// Returns a handle to the created audio worklet node object. |
| 172 | +EMSCRIPTEN_WEBAUDIO_T emscripten_create_wasm_audio_worklet_node(EMSCRIPTEN_WEBAUDIO_T audioContext, const char *name, const EmscriptenAudioWorkletNodeCreateOptions *options, EmscriptenWorkletNodeProcessCallback processCallback, void *userData4); |
166 | 173 |
|
167 | 174 | // Connects a node's output to a target, e.g., connect the worklet node to the context. |
168 | 175 | // For outputIndex and inputIndex, see the AudioNode.connect() documentation (setting 0 as the default values) |
|
0 commit comments