This callback will fire when the Wasm Module has been shared to the AudioWorklet global scope, and is now ready to begin adding Audio Worklet Processors.
| 148 | // AudioWorklet global scope, and is now ready to begin adding Audio Worklet |
| 149 | // Processors. |
| 150 | void WebAudioWorkletThreadInitialized(EMSCRIPTEN_WEBAUDIO_T audioContext, bool success, void *userData) { |
| 151 | assert(success && "Stopped in WebAudioWorkletThreadInitialized"); |
| 152 | |
| 153 | WebAudioWorkletProcessorCreateOptions opts = { |
| 154 | .name = "noise-generator", |
| 155 | }; |
| 156 | emscripten_create_wasm_audio_worklet_processor_async(audioContext, &opts, AudioWorkletProcessorCreated, 0); |
| 157 | } |
| 158 | |
| 159 | // Define a global stack space for the AudioWorkletGlobalScope. Note that all |
| 160 | // AudioWorkletProcessors and/or AudioWorkletNodes on the given Audio Context |