Unreal Engine 5 and Wwise Integration (Blueprint & C++)
Si prefieres leer una versión en Español, da click en este botón =>
Unreal Engine Version: 5.0.2
Wwise Version: 2021.1.8.7831
This is a simple guide on integrating the Wwise plugin with Unreal Engine 5 using the latest Event-Based Packaging method recommended by Audiokinetic. We will create an empty third-person project called "MyUE5Project".
IMPORTANT!
Event-Based Packaging has been deprecated, starting with Wwise 2022.1. The information on this blog post is not relevant anymore if you use this or a more modern version of Wwise. Please refer to the official documentation: Wwise - UE (Using the integration)
Blueprint Project:
Download and Install Wwise Launcher
Download Wwise Launcher from Audiokinetic's official site. You need to create an account to be able to use the software. Choose a version and your operating system.
After a successful install, open the Wwise Launcher and install the latest version of Wwise. If you need a particular version, you can search for that too; just make sure it is compatible with UE5.
2. Create your UE5 project and integrate Wwise's plugin
Open the Epic Games Launcher and create a new Blueprint - Third Person Project
Close your UE5 project and go back to Wwise Launcher. Click on Unreal > Integrate Wwise into Project… below your project's name::
Follow the instructions. If there are additional packages to be installed and click on Integrate and wait until you see "Operation Completed Successfully":
Open your UE5 project and check if the plugin was successfully installed. Go to Edit > Plugins and search for Wwise:
3. Event-Based Packaging
Wwise offers two types of asset management workflows: Soundbank-based and Event-Based Packaging. With the Soundbank-based workflow, the loading/unloading of the audio assets must be managed manually, which is time-consuming and can lead to errors. It is still the only method available for other game engines like Unity, and other audio middleware like FMOD, so it is still essential to know how to integrate audio with this workflow.
Event-Based Packaging is the most recent and practical approach because the asset management is done by the game engine, plus enables seamless communication between the Wwise authoring tool and Unreal Engine 5. You can use these workflows together, but we will use Event-Based Packaging for this tutorial.
From Audiokinetic's Blog:
Why would you want to do this? The reason is that in Wwise's traditional pipeline, the user is left to decide how to organize SoundBanks. In larger projects, this organization often takes a lot of time. And because it is manually organized and managed, redundancy is almost inevitable when loading resources. In the new EBP workflow, the resources corresponding to each event are automatically packaged into a SoundBank and stored in the
.uasset
of the event. When the event is called, only the corresponding media resources are loaded, effectively only loading as many resources as needed. This also means that the occurrence of resource redundancy is fundamentally eliminated. And since eachSoundBank
only contains the resources of one event, they can be flexibly unloaded without worrying about other events losing access to a resource.
Read more here:
Go to Edit > Project Settings > Wwise > Integration Settings and check “Event Based Packaging. “ A warning message will appear. Click on Yes.
A new message will appear about deleting the InitBank. Click on Delete. Still on the Project Settings menu, before you restart your project, go to Wwise > User Settings and check the boxes beside Enable Automatic Asset Synchronization and Auto Connect to WAAPI. Enabling these options will make Wwise and UE5 communicate so all the changes you make on Wwise appear instantly on UE5 and vice versa. Now, restart your project.
4. Open your Wwise project and set it up
Open the Wwise Launcher and click on Unreal > MyUE5Project > Open in Wwise to open your Wwise project. Make sure you are in the Designer layout by clicking on Layouts > Designer or pressing F5 on your keyboard.
Right-click on Default Work Unit below Actor-Mixer Hierarchy and select New Child > Sound SFX; name this SFX "TestSound."
Right-click on "TestSound" and import an audio file. You can drag and drop an audio file from your computer too.
5. Test the integration
Go back to your Unreal Engine's project and open the Content Drawer. Notice that you have a "WwiseAudio" folder populated with the same folder structure as your Wwise project. You will find the "PlayTestEvent" inside the Events/Default_Work_Unit folder:
Go to the UE5 menu bar and select Build > Generate Sound Data, and select your platforms:
Right-click on the "Play_TestEvent" and click on Play Event. You should be able to hear your audio event.
C++ Project:
Code
You need to have an IDE installed beforehand (Visual Studio for Windows or Xcode for Mac)
Follow the same steps as a Blueprint project. If you are creating a new project, select C++ instead of Blueprint. If you want to convert a Blueprint project to a C++ one, go to Tools > New C++ class and create a “dummy” empty class (If you are working with a team, please discuss this with your programmers). Your project will compile now….
2. Dependencies
Go to Tools > Open Visual Studio or Tools > Open Xcode. Inside your IDE, go to Games/MyUE5Project/Source/MyUE5Project and select MyUE5Project.build, and add “AkAudio” to the public dependencies:
This line should look like this (feel free to copy it):
PublicDependencyModuleNames.AddRange(new string[] {"Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "AkAudio"});
3. Compile
Save your modified code. Go back to your UE project and compile. All the Wwise's C++ API should be accessible now. You should be able to build your game too.