| Note:
A map with the parameters for all tutorials is available as part of the Unreal Demo Game downloadable from the Audiokinetic Launcher. It is called SpatialAudioTutorialMap. If you want to follow along with that map, you can skip the following sections. |
Create a New Project
Follow the steps below in order to build your working environment.
- Launch Unreal from the Epic launcher.
- Create a new Unreal Project C++ Blank project (without starter content).
- Close Unreal.
- Start the Audiokinetic Launcher.
- Install Wwise.
- Select the Unreal Engine tab.
- Click the Integrate Wwise into Project button.
- Launch Wwise using the Open in Wwise button.
- Launch Unreal using the Open in Unreal button.
Wwise Project Preparation
For the tutorial, you will need a Sound SFX and an Event to play it.
- In the Wwise project, create a new Sound SFX in the Default Work Unit of the Actor-Mixer Hierarchy and import a sound.
Make sure to enable Use game-defined auxiliary sends in the General Settings tab.
In the Positioning tab:
- Enable Listener Relative Routing
- Set 3D Spatialization to Position + Orientation
- Add an Attenuation with a Max distance of 5000.
- Enable Diffraction and Transmission
Right-click on the Sound SFX within the Actor-Mixer Hierarchy, then select New Event > Play.
- Open the Project Settings
In the Soundbanks tab, make sure Enable Auto-Defined SoudBanks is enabled.
- Save the project.
- Generate the SoundBanks.
Unreal Project Preparation
- Create a floor, a building with two rooms and an obstacle outside using your preferred method. In the SpatialAudioTutorialMap, we used a custom mesh for the building and a basic cube static mesh component for the obstacle outside.
- Place emitters in the scene:
Drag the Event created in the previous section from the Wwise Browser to the Content Browser.
- Drag the Event into the scene to create new
AkAmbientSound
actors.
- Place one of them outside and one in each room.
For all AkAmbientSound
actors, make sure to set Refresh Interval to 0.
Here's an image of the Spatial Audio Tutorial Map.
- Open the Level Blueprint from the Blueprints menu.
- Trigger events with user input.
- Drag a newly created AkAmbientSound from the World Outliner into the Blueprint.
- Find the "Post Associated Ak Event" function from the AkAmbientSound node.
- Right-click the Blueprint background and search for "Left Mouse Button".
- Connect the Pressed outlet to the "Post Associated Ak Event" Exec.
Repeat the same steps for all the AkAmbientSound items.
- Save and close the Level Blueprint.
Verify your Setup
- Start the scene. When pressing the respective buttons, you now hear the sounds play, spatialized in 3D.
Connect to Wwise Authoring and open the Profiler layout (shortcut F6).
- When playing the sound outside, you see a graph similar to the following one.