Version

menu_open
Wwise SDK 2024.1.0

◆ PostEvent() [1/2]

AKSOUNDENGINE_API AkPlayingID AK::SoundEngine::PostEvent ( AkUniqueID  in_eventID,
AkGameObjectID  in_gameObjectID,
AkUInt32  in_uFlags = 0,
AkCallbackFunc  in_pfnCallback = NULL,
void *  in_pCookie = NULL,
AkUInt32  in_cExternals = 0,
AkExternalSourceInfo in_pExternalSources = NULL,
AkPlayingID  in_PlayingID = AK_INVALID_PLAYING_ID 
)

Asynchronously posts an Event to the sound engine (by event ID).
The Event must be loaded through a SoundBank before the call to PostEvent. The callback function can be used to be notified when markers are reached or when the event is finished (see AkCallbackType). An array of wave file sources can be provided to resolve External Sources triggered by the event.

Returns
The playing ID of the event launched, or AK_INVALID_PLAYING_ID if posting the event failed and an error will be displayed in the debug console and the Wwise Profiler.
Remarks
If used, the array of external sources should contain the information for each external source triggered by the event. When triggering an event with multiple external sources, you need to differentiate each source by using the cookie property in the External Source in the Wwise project and in AkExternalSourceInfo.
Note: If an event triggers the playback of more than one external source, they must be named uniquely in the project (therefore have a unique cookie) in order to tell them apart when filling the AkExternalSourceInfo structures.
Note: If Wwise Authoring is connected to the game and "Profile And Edit (Sync All)" is used, the required Event doesn't have to be loaded before this function is called. If the Event is missing, it will be requested from Wwise Authoring directly, which might cause additional latency.
See also
Parameters
in_eventIDUnique ID of the event
in_gameObjectIDAssociated game object ID
in_uFlagsBitmask: see AkCallbackType
in_pfnCallbackCallback function
in_pCookieCallback cookie that will be sent to the callback function along with additional information
in_cExternalsOptional count of external source structures
in_pExternalSourcesOptional array of external source resolution information
in_PlayingIDOptional (advanced users only) Specify the playing ID to target with the event. Will Cause active actions in this event to target an existing Playing ID. Let it be AK_INVALID_PLAYING_ID or do not specify any for normal playback.

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