menu
Version
2022.1.18.8567
2024.1.4.8780
2023.1.12.8706
2022.1.18.8567
2021.1.14.8108
2019.2.15.7667
2019.1.11.7296
2018.1.11.6987
2017.2.10.6745
2017.1.9.6501
2016.2.6.6153
2015.1.9.5624
2024.1.4.8780
2023.1.12.8706
2022.1.18.8567
2021.1.14.8108
2019.2.15.7667
2019.1.11.7296
2018.1.11.6987
2017.2.10.6745
2017.1.9.6501
2016.2.6.6153
2015.1.9.5624
Wwise Unity Integration Documentation
|
The default way to support DLCs with Wwise is to use file packages. This is explained in part in the Authoring documentation: Wwise > Help > Finishing Your Project > Managing File Packages > Downloadable Content Overview. The short explanation is that these packages can contain BNK and WEM replacement or additional files, and they can be loaded and unloaded at will to enable or disable the DLC. This package format is optional, but it is currently built-in the Wwise/Unity plug-in. If you want to write your own package format, you'll need to write a new Low-Level IO to replace the default one.
To use packages in Unity, you simply have to place them in the Base Path, the path where your banks are, as defined in AkInitializer's properties. Then call AkSoundEngine.LoadFilePackage()
. Wwise will always try to load files through the file packages first, in the reverse order (last added is the first searched).
This method will work on all platforms that allow you to write on disk, into your Base Path, after the game is shipped. This is unfortunately not the case with iOS and Android.
On Android and iOS, since all the data is bundled into a read-only file system, you will need to put your packages in a different directory. This is done by calling AkSoundEngine.AddBasePath()
, before AkSoundEngine.LoadFilePackage(). You can add multiple paths, the last added will be searched first. Please check the appropriate Operating System documentation to find what are the restrictions. The code below is an example of code to select a path where you can store your files:
Note that there are several other writable paths on Android, such as the SD card or similar storage devices.
The Unity Addressables system can be used to package and distribute SoundBanks and streaming media files. For more information, consult the The Wwise Addressables Package for Unity page.
It is also possible to use the UnityWebRequest class from Unity to get your DLC audio files and load them directly. This is done through in-memory loading of banks, as demonstrated in AkMemBankLoader.cs. For older versions of Unity, AkMemBankLoader also loads banks with the (now obsolete) WWW class. If you are replacing existing banks with new ones, you must unload the previous banks first; the Wwise IO system would be unaware of that code so it can't determine if you're reloading the same bank by mistake or want to replace it.
Questions? Problems? Need more info? Contact us, and we can help!
Visit our Support pageRegister your project and we'll help you get started with no strings attached!
Get started with Wwise