Bedtime. /Audio Engine

Audio Engine

Real-time audio processing

void* engine_get_ctx(engine_t* engine)

Get callback context from engine (to access your model in callbacks)

engine_t*engineEngine pointer passed to your callback

Returns — Your callback context (typically your model pointer)

static void my_process(engine_t* engine, mixer_t* mix) {
    my_model_t* m = engine_get_ctx(engine);
    // Now use m->your_data
}
void engine_set_callbacks(os_app_t* app, void* cb_ctx)

Set audio engine callbacks for the app

os_app_t*appApp instance
void*cb_ctxCallback context (usually model pointer)
void engine_set_active(bool state)

Set audio engine active state

boolstatetrue to enable processing, false to disable
void engine_clear_callbacks(const engine_callbacks_t* cb)

Clear audio engine callbacks

const engine_callbacks_t*cb

Warning — Call this in your deinit() callback before the TAPP unloads to prevent the engine from calling freed TAPP code.