Project Acoustics Wwise Integration for Unity Beta
This article describes the beta Unity + Wwise package for Project Acoustics. This package contains a full sample including Unity and Wwise projects.
Software requirements:
- Unity for Windows
- AudioKinetic Wwise 2021+
- Project Acoustics Unity package
Sample Setup
- Download the Unity + Wwise Beta package.
- Create a new Unity 3D project. Once Unity has initialized, save and close the project.
- Integrate Wwise 2021+ into your new Unity project. During integration, specify the provided Wwise project instead of creating a new Wwise project.
- Open Unity and import MicrosoftAcoustics.Wwise.unitypackage
- There will be a few minor compiler errors. Open AkGameObj.cs. Change the visibility of Awake(), Update() and OnDestroy() from private to protected.
- Open AcousticsDemo/ProjectAcousticsDemo.unity
- Open the WwisePicker and ensure the data from the Wwise project is properly displayed.
- On the WwiseGlobal object in the Hierarchy, add an
AkBank
component. Populate theName
withAcousticsGameSoundBank
.
- On the
Audio Clip
underSound Sources
in the Hierarchy, add anAkEvent
component. Populate theName
withDemoSounds_Play
.
- On the
MicrosoftAcoustics
prefab in the Hierarchy, ensure the connection to the aux busses is preserved. If not, recreate it as shown below. Also make sure theListener Obj
field is populated withMain Camera
.
- Click Play. Make sure you hear audio. If not, check your setup steps. The exact order of steps is very important.
Wwise Project Layout
The Wwise project included in this beta is very different from the one included in the Unreal + Wwise integration. This project uses the new spatial audio object pipeline available in Wwise 2021, as well as a specific reverb bus setup to support blending between different length reverbs.
Enable 3D audio support
Wwise 2021 uses platform features to enable spatialization. Double click the System Audio Device and make sure the Allow 3D Audio checkbox is checked. This will enable audio spatialization in whatever format the user has chosen for their audio endpoint.
Audio Object Bus
Use an aux bus configured for audio objects as the main dry path bus. Any 3D objects should be routed to this bus. To set this up, create a new aux bus, and set its Bus Configuration to Audio Objects
Reverb Busses
Project Acoustics enables blending between different reverb lengths based on the scene's geometry and material composition. In order to do this, the sample uses multiple instances of Wwise's Convolution Reverb plugin. The beta package provides impulse responses of varying lengths and uses game code to blend sends between each bus. Project Acoustics also blends between indoor and outdoor reverbs in a similar fashion. Supporting the combination of indoor, outdoor, and varying reverb times requires the use of six different reverb busses. Each reverb bus has an instance of Wwise Convolution Reverb on it, with a different impulse response for short, medium, and long reverb times. The impulse responses included in this package have been specially tuned for this setup - generic impulse responses are not currently supported.
Note
The Wwise Convolution Reverb plugin does not support audio objects. If audio objects are inadvertently sent to one of the reverb busses, the Wwise Convolution Reverb plugin will be disabled, and you won't hear any reverb. To prevent your bus from accidentally having audio objects sent to it, make sure to configure your reverb busses to 2.0.
Audio Source Setup
Configuring audio sources in Wwise is easy. The only requirement is to enable Use game-defined aux sends, as seen here.
That's all the Wwise setup required. Generate sound banks and move over to Unity.
Unity Project Layout
For the most part, using Project Acoustics with Wwise should feel the same as using Wwise on its own. There are only a few minor differences, detailed below.
Use AcousticsGameObj
Wwise uses AkGameObj components for all audio playback. Project Acoustics extends this class to allow it to use acoustics metadata. For any sounds that you want to play with Project Acoustics, make sure to use an AcousticsGameObj instead. Because it extends the AkGameObj class, you can use AcousticsGameObj anywhere you'd usually use an AkGameObj, like with AkEvents.
Here you will also find the design controls that will be familiar if you've previously used the Project Acoustics Unity integration.
Populate Busses on AcousticsManager
The AcousticsManager component has some new fields in it to support reverb. In addition to specifying an ACE file, there are also fields for the various reverb sends, the AkListener object, and optional states to trigger when the ACE file is loaded or unloaded. You must set the indoor and outdoor reverb fields to the busses from your Wwise project. Earlier on this page, we specified how to configure these busses to work with the provided sample, but you can customize these based on the needs of your project. You must also populate the Listener Obj field with the Game Object that contains the AkListener (typically residing on the Main Camera, as in the sample setup above). The Bake Loaded State and No Bake State are optional, and will trigger when an ACE file is loaded or unloaded, respectively.
Next steps
- Learn how to do bakes for your game scenes.