-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
I wonder, if it is possible to pass a struct like this as userData:
struct AudioStruct{
int numInputs = 0;
int numOutputs = 0;
ofBuffer inBuffer;
ofBuffer outBuffer;
}
AudioStruct audioData; //defined somewhere in the class
audioData.inputs = 2;
audioData.outputs = 0;
emscripten_start_wasm_audio_worklet_thread_async(context, wasmAudioWorkletStack, sizeof(wasmAudioWorkletStack), WebAudioWorkletThreadInitialized, (void *)&audioData);
And then read it in ProcessAudio?
EM_BOOL ProcessAudio(int numInputs, const AudioSampleFrame *inputs, int numOutputs, AudioSampleFrame *outputs, int numParams, const AudioParamFrame *params, void *userData)
{
#ifdef REPORT_RESULT
++audioProcessedCount;
#endif
AudioStruct * audioData = (AudioStruct *) userData; //everything you need in the struct
audioData->outBuffer = .....
I copied the code examples from here: openframeworks/openFrameworks#7363
Metadata
Metadata
Assignees
Labels
No labels