Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

UE5 Event ID not found until right click and playing event once in editor

0 votes
Hello,

To summarize the issue, Event ID's aren't recognized in my wwise integrated UE5 project until the event is manually played by right clicking the AKEvent asset and clicking the Play Event action in editor.

I have a wwise project with a single sound bank and 2 events. These events work as expected in the wwise project. I've integrated with Unreal 5 and successfully can play audio.

In my Unreal project I'm calling the events via the AudioDevice->PostEventOnActor function in c++, passing in the explicit event id for the event I'd like played. I have a properly named AK Event asset for each event. Right clicking play on these events works as expected.

This issue is that upon initially opening the project (or in a packaged build), attempting to post the event by ID at runtime results in "Event ID not found". However, if I right click and play any one of the the events in the content browser, it now locates the event's and plays as expected at runtime.

In troubleshooting I thought it may be related to the InitSound bank being loaded which doesn't contain a reference to these events, and that playing the event in editor via the AK action may be loading and caching the proper soundbank behind the scenes - however I can't confirm this and am finding conflicting information on if this current version requires me to explicitly load my Soundbank prior to posting the event with the introduction of Auto Defined Sound banks and EBP. It seems that this version of wwise stripped the ability to toggle EBP and auto asset sync on or off to test if it's related.

Any advice on this?

Details
Unreal Engine Project Version: 5.0
Wwise Integration 2022.1.0.7985.2398
asked Sep 25, 2022 in General Discussion by Mason E. (140 points)

1 Answer

+1 vote
 
Best answer

Hi Mason,
The 2022.1 integration is designed so that loading an Unreal asset corresponding to a Wwise object will load its required resources (SoundBanks and media files). Because you are following a code path that does not require you to load the Event assets before posting them, the sound engine does not have the information necessary to play the event. Right-clicking or inspecting an asset in the Editor automatically loads it (and assets don't really get unloaded when working in editor), which explains why previewing your events would temporarily fix the problem.

The simplest way to ensure you are loading your Events properly before playing them is to use PostEvent API functions that take a reference to an AkAudioEvent as an argument. Another way to ensure these assets are loaded is to reference them in some manner in the Maps or Blueprints that use them, this way all the necessary resuorces will be loaded with the level (or asset using the blueprint).
If you are working purely from code, you will likely have to use Unreal's asset loading uitilities such as the StreamableManager.

answered Sep 26, 2022 by Etienne R. (Audiokinetic) (1,140 points)
selected Sep 26, 2022 by Mason E.
Thanks for the quick and thorough response! Storing an AkAudioEvent and passing the reference into AudioDevice->PostAkAudioEventOnActor worked like a charm. Confirmed my suspicions that calling an event by ID without prior explicit loading wasn't working as I had expected.

Thanks for the help.
...