Community Q&A

Where Wwise users help each other out!

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

Ue4 Ak Post Event via string not working in standalone mode (events not included in build)

–1 vote
  • Wwise 2019.2.5 + UE4.2whatever (event based packaging enabled)

In most of my blueprints I'm assigning event names VIA strings (easier to swap event strings that way). Everything works great in the editor, but playing the game in standalone mode, only sounds with the events assigned directly (in a BP, or on the Ak component) will play. Interestingly enough, if I add an Ak PostEvent Action to my BP then assign it an event directly, that event will work when playing the game in standalone mode. The Action doesn't even need to be hooked up to play in order to work in standalone mode.

I'm guessing Unreal only packages events that are referenced on/ in a BP directly as to not bloat the build with "unused assets" when building or using standalone mode. Is this a build settings thing where I need to include the whole WwiseAudio folder?

It would be great to get some more documentation or videos from the AK team on how event based packaging works. The feature is great! But looks like some workflows don't work super well with it. Also it's unclear to me when events are being loaded; I'd assume it when the event is called, but this makes me think it might be different. Maybe adding an option in the Wwise profiler to see when an event is loaded/ unloaded would help?

A great feature would be an option to include all audio data in the WwiseAudio folder in my unreal project into builds in the Project Settings. Or maybe I just need an engineer to do that for me. But they are just as confused as I am and my bribe budget for them is running low.

asked Sep 18, 2020 in Feature Requests by Austin D. (90 points)

1 Answer

–1 vote
If you want your game to always load every sound, that defeats the purpose of event-based packaging. If that's what you want, you're better off with the old Sound Bank system. You just create one big Sound Bank in Wwise, load the soundbank in your game at init, and voila! You can call any sound any time with a string.

Event-based packaging works on the idea of Unreal only loading exactly what sounds it needs, to save memory. So if an actor/component/etc.. has an AkAudioEvent loaded on it, it will load when the level loads, or when the object gets spawned, etc..

But maybe you like event based packaging most of the time, but you'd like to to things the old-fashioned way in some situations.

Here's some ideas:

use LoadObject to get the AkAudioEvent you need, when you need it. Then it will be loaded, and PostEvent will work.

UAkAudioEvent* Event = LoadObject(null, "Game/WwiseAudio/path/to/objectName.objectName")

You could hold events like these in a data structure, so you don't have to Load them every time. You could even implement some "garbage collection" to Unload events that haven't

been used in a while.

Another idea (less certain of this one, but it works in theory): Would be to simply use an AkSoundBank for some of your sounds. Create the banks in Wwise, then next time you sync assets in Unreal, you'll get the bank you created as an AkAudioBank, and you can load it in code at Initialization, or have it referenced by a blueprint that's instantiated in your level, and that should auto-load it.
answered Oct 8 by Eric C. (190 points) 1 flag
TY for the reply, super funny it's a year after I initially asked this, but I appreciate the time put into the response and hope this can help anyone else that runs into a similar issue.

Using LoadObject in BPs should work, but seems cumbersome to upkeep as designs change, the team scales, scope increases. The classic game dev stuff where you can only keep so many plates spinning with the resources at hand.

The solution I came to on this was to divide my Events Tab into some macro workunits of directly referenced events and indirectly referenced events. Direct references work great with EBP in a build, since UE4 knows the file is getting used, so it needs to include it in a build.

Indirect references (Ex - two characters use the same anim, but you want to have different sounds for a whoosh based on character or weapon type or whatever, so you swap a piece of the event name) were placed in specific folders that got tied into Enumerator tags that are set on the character. With a specific tag, UE4 knows to build the assets in the folder if a character is included now. Similar to soundbanks, but less manual maintenance. If you swap a tag on a character, all the loading and event swapping should happen automatically. All it needs is a consistent naming convention.

There's probably a smarter way to do it! But this one works for my project. Good luck to anyone else that runs into a similar confusing thing!
...