Version
menu

Wwise SDK 2025.1.0
AkCmd_PostEvent Struct Reference

#include <AkCommandTypes.h>

Public Attributes

AkPlayingID playingID
 Unique ID that will be associated with this playback. Use AK_SoundEngine_GeneratePlayingID() to generate a new unique playing ID. More...
 
AkUniqueID eventID
 Unique ID of the event. More...
 
AkGameObjectID gameObjectID
 Associated game object ID. More...
 
AkPlayingID actionTargetPlayingID
 Filters the "Target" of actions in the event by a playing ID. Set to AK_INVALID_PLAYING_ID to disable target filtering. Not all actions are affected by this; see AkActionOnEventType for the list of action types affected by this option. More...
 
AkUInt32 flags
 (optional) Bitmask: see AkCallbackType More...
 
AkEventCallbackFunc callback
 (optional) Callback function More...
 
void * callbackCookie
 (optional) Callback cookie More...
 
AkUInt32 numExternalSources
 (optional) Number of elements in externalSources array More...
 

Detailed Description

Posts an event. When this command is executed, the actions referenced in the event will be executed. The user is responsible for providing a new unique playingID value for every instance of this command. Re-using the same playing ID will cause actions in this event to be associated with an existing playback.

If numExternalSources is set to a value higher than 0, then the client is expected to call AK_CommandBuffer_AddExternalSources after the command:

auto cmd = (AkCmd_PostEvent*)AK_CommandBuffer_Add(buffer, AkCommand_PostEvent);
// Fill out the command...
cmd->numExternalSources = myExternalSourcesArray.size();
AK_CommandBuffer_AddExternalSources(buffer, myExternalSourcesArray.size(), myExternalSourcesArray.data());

This command can fail for the following reasons:

  • AK_InvalidParameter: eventID is not valid or numExternalSources is higher than 0 and not enough external sources were added after the command.
  • AK_InsufficientMemory: Failed to allocate memory necessary to begin processing the command
  • AK_ResourceInUse: playingID was already used in a previous post event command. Use AK_SoundEngine_GeneratePlayingID() to ensure that a unique ID is generated for each post event command.
  • AK_IDNotFound: Event ID not found.
  • AK_PartialSuccess: When connected to the Wwise Profiler, command has been delayed to a later frame until Wwise synchronizes the event.
  • AK_MaxReached: Event Cooldown parameters for eventID did not allow the event to play.
See also

Definition at line 140 of file AkCommandTypes.h.


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