Table of Contents
Encoding your media to a compressed format like Vorbis allows you to ship a game with a relatively small size footprint and then decompress the SoundBanks when loading the game. However, the process of decoding an entire SoundBank might be quite resource demanding, especially if required at every game initialization. If you are not restricted to keep a low storage usage once the game is installed, you might want to consider the Save decoded bank option in the AkBank component. When saving a decoded SoundBank, the decoded SoundBank will be saved in the DecodedBanks folder next to the generated SoundBanks. If the AkBank is set to Save decoded bank, it will first look to the DecodedBanks folder for the SoundBank and, if it is newer than the original, load that one instead. As such, the SoundBank will not have to be decoded when loaded, allowing you to completely avoid using resources decoding Vorbis encoded media files.
Saving a decoded SoundBank will require storage space relative to the Decoded Size estimate in the SoundBank Manager. Before you configure the AkBank to Save decoded bank, consider what storage resources the user might have. For example, desktops and laptops will often have larger disk space than mobile devices.
In the following steps, you will be asked to save the decoded Dungeon SoundBank.
In the Unity menu, go to Audiokinetic > Certification > 301 > Lesson 3 and select Saving a Decoded SoundBank.
Before enabling the Save decoded bank option, let's have a look at the folder where the SoundBanks are stored. A quick and handy way to find your generated Soundbanks, is to select a SoundBank in the Wwise Authoring tool and open it from there. This will also ensure that the SoundBanks you navigate to are the ones generated from the same Wwise project.
In Wwise, go to Layouts, select SoundBank.
In the SoundBank Manager, expand Region, right-click the Dungeon SoundBank, and select Open Containing Folder (Dungeon.bnk).
The GeneratedSoundBanks folder will be revealed, with the Dungeon.bnk file selected. This is where all generated SoundBanks will be stored, along with various files for streaming (archived in the WEM file format).
Notice that there are various BNK and TXT files, along with an English (US) folder, but not yet anything indicating where the Decoded SoundBanks will be stored. Let's save the decoded Dungeon SoundBank and look at the folder again.
In the Dungeon Audio Environment scene, select the Wwise game object.
In the Inspector's AkBank component, select Save decoded bank.
You only need to initialize the scene, as the SoundBanks will be saved at initialization.
Press ESC to open the WAG menu and click Play again to exit Play mode.
By looking in the GeneratedSoundBanks folder, you will now see a DecodedBanks folder.
Open the DecodedBanks folder.
Here you will find the decoded Dungeon.bnk SoundBank. Notice that it is quite larger than the Wwise-generated one located in the parent folder, a result of decompressing all the Vorbis encoded media.
From now on, when the Dungeon SoundBank is loaded, Wwise will discover that there is a decoded Dungeon.bnk SoundBank in the DecodedBanks folder and load that one instead. This allows you to avoid using resources on decoding Vorbis encoded media. As you will now see, the Dungeon SoundBank appearing in the Memory tab will now have its own memory allocation like any other SoundBank, rather than having to use the PreparePool memory pool.