Table des matières
-
Lessons
By creating the Desert SoundBank, adding content, and generating it, the SoundBank is ready then loaded in WAG. When saving the project, the Wwise Unity Integration will automatically register the new state of SoundBanks, and so you can add the SoundBank in an AkBank script. Let’s now open the WAG Unity project and locate the All_In_One SoundBank.
-
From the WAG Unity project’s Audiokinetic menu, go to Certification > 251 > Lesson 6 and select Loading Region SoundBanks.
-
In the Hierarchy window, go to Wwise and select the Ak_Bank game-object.
-
In the Inspector, locate the AkBank with the assigned All_In_One Soundbank.
While using Region SoundBanks, there are many Events that are used throughout all regions. These are located in the General SoundBank. As such, let’s change the All_In_One SoundBank to the General, which does not include the audio for a specific region.
-
Open the Bank Name list and change it to the General SoundBank (not the Work Unit).
You’re now loading the General SoundBank, and you can enable the loading of the region SoundBanks. A common method to load SoundBanks in different regions is to use Trigger colliders. When the Audio Listener enters the Trigger, the SoundBank will load.
In the above image, you see the Trigger for the desert region. Whenever the listener enters the Trigger, the Desert Audio Environment Unity scene will be loaded. This scene contains the SoundBank along with various Events triggered within that region. Let’s now enable the region SoundBank Triggers and assign the newly created Desert SoundBank.
In the Wwise Adventure Game, the Audio Listener is located on the Main Camera, but the listener probe is located on the player.
-
In the Hierarchy window, select the Bank Regions.
Notice that this game-object is grayed out, which means that it’s not enabled. Within it, you’ll find the various region Triggers. Let’s now enable all Triggers by enabling their parent game-object.
-
In the Inspector, enable the Bank Regions and save your changes.
-
From the Audiokinetic menu, go to Certification > 251 > Lesson 6 and select Desert SoundBank Scenes.
-
In the Hierarchy window, select the Wwise game-object.
-
In the Inspector’s AkBank (Script), click the Bank Name list and double-click the Region > Desert SoundBank.
The Desert Region SoundBank’s scene will now not load the All_In_One SoundBank, but instead the General SoundBank. And when entering the different regions, the SoundBank assigned to that region will load.