Version
For the Android platform, when checking the Unity option Player Settings > Publishing Settings > Split Application Binary, APK Expansion Files are used for bundling the project assets. This effectively creates a zip file with the .obb extension that contains the StreamingAssets folder, including the SoundBanks. The default Android SoundBank loading support assumes that SoundBanks are located in either the APK file or OBB file.
If you are constructing your own OBB file externally, note that the inner path given to AkSoundEngine.SetBasePath must be the same in the OBB. OBB files must be uncompressed and unencrypted for the default I/O system to work. If this is not the case, then you will need to uncompress the OBB in the persistent data path. The CPU cost to uncompress is too high to uncompress on the fly.
Alternatively, you can use in-memory loading of banks. An example is provided in AkMemBankLoader.cs. This script tries to load the specified SoundBank at the start time of the scene, and unload it when the scene is destroyed. The following changes need to be made to use this example:
Is
Localized
Bank
option if the SoundBank is localized. It will use the global language defined in AkInitializer.cs
.Two methods AkMemBankLoader.LoadNonLocalizedBank()
and AkMemBankLoader
. LoadLocalizedBank()
can also be called directly in code for the non-localized and localized SoundBanks.
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