This Tutorial will guide you through the first steps in getting your Audio from Wwise working inside CRYENGINE using the new Audio Translation Layer (ATL) System.
First Steps with Wwise and CRYENGINE
Setting up Wwise and CRYENGINE
Wwise Project and Soundbank Locations
When using Wwise with CRYENGINE there are two locations that are used for the Wwise specific Data.
If you look at the CRYENGINE GameSDK they are located in:
Soundbanks -> .../GameSDK/Sounds/wwise
Wwise Project -> .../GameSDK/Sounds/wwise_project
CRYENGINE will look into these folders to locate all the WwiseControls and Soundbanks that will then be displayed in the Audio Controls Editor.
Don't alter the path described above as it will make the Audio Controls Editor fail to locate the corresponding PlayEvents and SoundBanks.
Wwise Project and Soundbanks
When you ship your Game only the Soundbanks need to be included in the Game Folder as they contain all data from the WwiseProject.
Verifying the Supported Wwise Version
Before setting up your WwiseProject you should make sure that you are using the correct version of Wwise with CRYENGINE.
CRYENGINE is always updated to support the current version of Wwise.
To make sure that you are using the correct version open any Level in CRYENGINE, then open the Console and type s_DrawAudioDebug
You will then see (in the top left hand corner) the current version of Wwise that is supported by the Audio Translation Layer in your CRYENGINE build.
You can download all Wwise versions from here.
Creating an Audio Setup for CRYENGINE in Wwise
If you are new to Wwise we recommend you read Audiokinetics Wwise Get Started Guide this will help you to get familiar with the concepts of the software. Better still complete the Wwise 101 course - available here
Also, you can make use of the Documentation built right into Wwise by clicking the ? icon in the top-right corner of each window.
Creating a Sound Object in Wwise
In Wwise you can import Sounds into the Actor-Mixer Hierarchy with the simple drag and drop functionality or by using the Import Function (Project/ImportAudioFiles).
Once you have imported an Audio file in .wav format Wwise will create a new Sound Object for it.
For each Sound Object in Wwise you can specify multiple Parameters in the Property Editor that will open once you have it selected in the Project Explorer.
In order to access the Property Editor make sure that you are using the Designer Layout in Wwise. This can be found and activated under "Layouts" in the menu bar.
In the Property Editor you can change Parameters including the Volume, Pitch, Low/High-Pass Filtering, Routing and Positioning of the SoundSFX Object.
Creating an Event in Wwise
In order to make your imported sound visible to the CRYENGINE ATL-System an Event has to be created for it inside of Wwise.
Wwise Events can perform multiple Actions, the most basic and often used is the Play-Action which will play back an Object from the Actor-Mixer Hierarchy.
To create an Event for your Sound Object, simply right-click on the Sound Object in the Actor-Mixer-Hierarchy and select: NewEvent/Play.
If you now look in the Events Tab of the Project Explorer Window you can see your newly created event.
We recommend that you use prefixes for Events as they can undertake multiple actions (for example also stopping a sound).
Events therefore should be called Play_(...), Stop_(...) and so on in order to enhance their readability in both Wwise and CRYENGINE.
Creating a Soundbank in Wwise
To integrate the newly created Event into your Game you will now have to create a Soundbank in Wwise that can be loaded by CRYENGINE.
In Wwise open the Soundbank tab and create a new bank.
Now it is time to populate the Soundbank with the Audio Content that you have created.
The easiest way to do this is to drag the Workunit, in which you created your Event into the Soundbank Property Editor. You can open the Soundbank Property Editor by double clicking on the Soundbank object.
If you add the Workunit from the Events Tab in the Project Explorer to the Soundbank all of its Events and associated Sound Objects and Media Files will be automatically included with it.
Now all newly created Events inside of the included Workunit will also be automatically included in your Soundbank whenever you generate it.
Remember that the Soundbanks have to be located in the location .../Sounds/wwise in order to be visible to the Audio Controls Editor.
You can setup Wwise to automatically generate the Soundbanks in the correct location by entering ..\wwise\ as the path under ProjectSettings/Soundbanks.
This will generate all Soundbanks in the location "<GameFolder>/sounds/wwise" when your wwise_project is correctly located in "<GameFolder>/sounds/wwise_project".
Connecting WwiseControls to the Audio Translation Layer (ATL)
Now that we have created our setup in Wwise the Audio Controls Editor will be able to recognize the Wwise Controls and Soundbanks.
Open CRYENGINE and select the Audio Controls Editor under View/OpenViewPane/AudioControlsEditor.
Now the Audio Controls Editor will be showing you all Wwise Controls contained in your Wwise Project as well as your generated Soundbanks.
You can now connect them to the Audio Translation Layer in order to integrate them into your level in CRYENGINE.
For this first create a new folder in the Audio Controls Editor by selecting the +Add Button and choosing Folder from the popup selection.
After the folder has been created simply drag and drop the WwiseControls into the new Folder on the ATL Controls side.
CRYENGINE will automatically create the corresponding connected ATL Controls and name them after their Wwise counterparts.
You will see that two types of ATL Controls have been created, an ATL Trigger & an ATL Preload.
The ATL Trigger will be used to call the Wwise Event in your Game while the ATL Preload will be used to load the Wwise Soundbanks so that all data for the Event is included in Memory.
CRYENGINE requires the Wwise Soundbank containing your Event Data to be loaded in order to play Sound in your Level.
Therefore, make sure to connect your Wwise Soundbanks to ATL Preloads and update them when adding new content in Wwise.
You can learn more about creating Soundbanks in Wwise here.
On the ATL preload make sure that the Auto-Load checkbox is activated and leave the Scope on Global for now.
You can read more about using scopes in the Audio Controls Editor here.
Placing an ATL Trigger in the Game
If you have followed the above steps you can now select your ATL trigger in the Editor and play it back on an Audio Entity.
You can pre-listen to your ATL Triggers in the Audio Controls Editor by right-clicking on it and selecting "Execute Trigger".
In order to hear your sound in the Game we are going to place an Audio Entity in the Level which will be executing the Audio Trigger during Gameplay.
For each Level it is recommended to first create a dedicated Audio Layer which will contain all your Audio Data. For this click the Layer icon in the RollupBar, create a new Layer and name it Audio.
As long as the Audio Layer is selected all Entities that you are placing in the Level will be included in this layer.
Now go back to the Objects tab in the RollupBar and select the AudioTriggerSpot Entity in the Audio Tab and place the Entity in the Level.
As a rule it is always useful to name your Audio Entities with abbreviations to improve readability in large projects.
For the AudioTriggerSpot we are using the ATS abbreviation. Therefore, a small fire sound could be called ATS_small_fire on the AudioTriggerSpot in the Level.
If you have followed the above steps correctly you can now select your created ATL trigger in the Properties of the AudioTriggerSpot.
It will be played back as soon as the AudioTriggerSpot Entity is enabled.
Using the StopTrigger
In Wwise you won't need to create a Stop Trigger if you simply want to end the sound when the StopTrigger is executed.
If the StopTrigger is executed CRYENGINE will automatically stop the playing WwiseEvent if the StopTriggerName is left empty.
This is important to remember as it's the same behaviour in all places in CRYENGINE where a StopTrigger can be used.
Congratulations, you now have imported and played back your first Audio Asset from Wwise in CRYENGINE.
For further learning take a look at the functionality of the AudioTriggerSpot in combination with Wwise here.