Wwise Unity Integration Documentation
The Integration provides Wwise-specific components you can use directly on Unity Scene GameObjects. These components should cover most sound design scenarios. While the components are custom C# scripts, no coding is required to edit their public properties.
To add Wwise components to Unity GameObjects:
- Go to the Unity Inspector window (Ctrl+3) loaded with the GameObject selected in the scene.
- Click Add Component to prompt the Component list.
- Select Wwise to open its sublist and choose the desired Wwise Components.
Tip: Type "ak" in the component search field to more quickly access a list containing all the Wwise components.
You can add components to your game by dragging Wwise objects from the Wwise Picker to either the Inspector or onto game objects listed in the Hierarchy of your loaded scene.
The WwiseGlobal object is a GameObject that contains the Initializing and Terminating scripts for the Wwise Sound Engine. In the Editor workflow, it is added to every scene, so that it can be properly previewed in the Editor. In the game, only one instance is created, in the first scene, and it is persisted throughout the game. There are a few customizable options in the initializer script.
If you want to disable this behavior, use Edit > Project Settings > Wwise Editor and disable Create WwiseGlobal GameObject. It then becomes your responsability to add the initializer script on an object that will persist throughout the game.
In order for positioning to work, the Ak Audio Listener script needs to be attached to the main camera in every scene. By default the listener is added automatically to the main camera. If you want to disable this behavior, go to Edit > Project Settings > Wwise Editor and disable Automatically add Listener to Main Camera.
This integration also provides a few classes that can be used, with minimal code, for most remaining usage scenarios:
This type represents an auxiliary send in the Master-Mixer Hierarchy.
This type can be used to load/unload SoundBanks.
This type represents the values of the flags used when posting an Event with a callback.
This type can be used to post Events to the sound engine.
This type can be used to set game parameter values to the sound engine.
This type can be used to set Wwise States.
This type can be used to set Switch values on gameobjects.
This type can be used to post triggers to the sound engine.
This type represents an Acoustic Texture.
- See also
A native WAAPI client with a C# API allows you to connect to WAAPI from within Unity. It currently is available for Windows and macOS. The Wwise Authoring API sends messages via JSON objects. In Unity, the client was implemented using strings. You may use your preferred method to construct valid JSON strings to then give to the WAAPI client.
- See also
There are four ways to add sounds to your game:
- Using the Wwise Picker. This is the simplest way to add a sound to an object. Drag an Event from the Wwise Picker window to an object in the Unity Viewer or the Inspector. This automatically creates an AkAmbient component on the target Game Object.
- Using the Add Component menu. Add an AkAmbient or an AkEvent component to any Unity Game Object.
Using Wwise Types. Call
AK.Wwise.Event.Post()at any time from a C# script.
Using scripts. Call
AkSoundEngine.PostEvent()at any time from a C# script.
For Unity's Timeline feature, there are custom Wwise tracks for triggering Wwise events and setting Wwise RTPC values.
- See also