Version
menu_open
Attention : vous avez été redirigé vers la plus récente documentation correspondant à votre version générale ( 2022.1.13.8454 ). Si vous souhaitez accéder à la documentation de votre version précise, veuillez télécharger la documentation hors ligne depuis l'Audiokinetic Launcher et sélectionner l'option de documentation Offline dans l'application de création Wwise.
Wwise Unity Integration Documentation
Making DLCs with Wwise and Unity

Using Wwise File Packages

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:

#if UNITY_IPHONE
string fileNameBase = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf('/'));
fileName = fileNameBase.Substring(0, fileNameBase.LastIndexOf('/')) + "/Documents/" + FILE_NAME;
#elif UNITY_ANDROID
fileName = Application.persistentDataPath + "/" + FILE_NAME ;
#else
fileName = Application.dataPath + "/" + FILE_NAME;
#endif

Note that there are several other writable paths on Android, such as the SD card or similar storage devices.

See also

Using Addressables

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.

Streaming Banks Using UnityWebRequest

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.


Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise