Version

menu_open
Wwise SDK 2023.1.2

◆ RegisterGlobalCallback()

virtual AKRESULT AK::IAkGlobalPluginContext::RegisterGlobalCallback ( AkPluginType  in_eType,
AkUInt32  in_ulCompanyID,
AkUInt32  in_ulPluginID,
AkGlobalCallbackFunc  in_pCallback,
AkUInt32  in_eLocation = AkGlobalCallbackLocation_BeginRender,
void *  in_pCookie = NULL 
)
pure virtual

Register a global callback function. This function will be called from the audio rendering thread, at the location specified by in_eLocation. This function will also be called from the thread calling AK::SoundEngine::Term with in_eLocation set to AkGlobalCallbackLocation_Term. For example, in order to be called at every audio rendering pass, and once during teardown for releasing resources, you would call RegisterGlobalCallback(AkPluginTypeEffect, MY_COMPANY_ID , MY_PLUGIN_ID, myCallback, AkGlobalCallbackLocation_BeginRender | AkGlobalCallbackLocation_Term, myCookie);

Remarks
A valid (not AkPluginTypeNone) Plugin Type, Company ID and valid (non-zero) Plug-in ID of the plug-in registering the callback must be provided to this function. The timing of the callback function will contribute to the timing of the plug-in registered (Total Plug-in CPU and Advanced Profiler Plug-in tab). Timers will be registered to callbacks at all locations except for AkGlobalCallbackLocation::AkGlobalCallbackLocation_Register and AkGlobalCallbackLocation::AkGlobalCallbackLocation_Term. It is only legal to call this function from inside the plug-in registration callback, exclusively when receiving AkGlobalCallbackLocation::AkGlobalCallbackLocation_Register. This function should not be called from inside the plug-in instance (e.g. in Init, Execute, etc.) to prevent deadlocks when processing plug-ins in parallel. It is illegal to call this function while already inside of a registered global callback. This function might stall for several milliseconds before returning.
See also
Parameters
in_eTypeA valid Plug-in type (for example, source or effect).
in_ulCompanyIDCompany identifier (as declared in the plug-in description XML file).
in_ulPluginIDPlug-in identifier (as declared in the plug-in description XML file).
in_pCallbackFunction to register as a global callback.
in_eLocationCallback location defined in AkGlobalCallbackLocation. Bitwise OR multiple locations if needed.
in_pCookieUser cookie.

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise