-
Notifications
You must be signed in to change notification settings - Fork 13
Loading Soundbanks
Before attempting to load any banks, make sure to set the correct Base path location in the Wwise settings located in the Project Settings (the Advanced Settings toggle at the top right section of the window needs to be activated for the Wwise settings to show up):
By default, the integration uses Soundbank names for loading soundbanks. However, if you prefer to use IDs instead, follow the steps below to deactivate the "Use SoundBank Names for Filenames" setting:
- Open the Wwise authoring app and go to the SoundBanks settings.
- Locate the "Use SoundBank Names for Filenames" setting and deactivate it.
- Additionally, deactivate the "Use Soundbank names" setting in the Project settings:
By deactivating these settings, the integration will use IDs instead of Soundbank names for loading soundbanks. Make sure to regenerate your banks after applying these settings.
The integration provides a custom node called AkBank
that allows you to select a soundbank and load or unload it using the Enter Tree
, Ready
, or Exit Tree
callbacks:
To select a bank, click on the Select Bank...
button in the inspector, and a list of soundbanks will appear. Simply click on the desired bank to select it. Select when the bank should be loaded/unload in the Load On
and Unload On
properties of the node.
The simplest way to load banks in GDScript is by calling load_bank
on the Wwise
singleton:
func _enter_tree():
Wwise.load_bank("Init")
Wwise.load_bank("TestBank")
To unload a bank, call unload_bank
:
func _enter_tree():
Wwise.unload_bank("TestBank")
Alternatively, you can directly pass the generated IDs to load_bank_id
(if you are not using soundbank names):
func _enter_tree():
Wwise.load_bank_id(AK.BANKS.INIT)
Wwise.load_bank_id(AK.BANKS.TESTBANK)
You can load banks asynchronously by calling load_bank_async
or load_bank_async_id
:
extends Node
var cookie_wrapper = CookieWrapper.new()
var callable = Callable(self, "_bank_callback")
func _enter_tree():
cookie_wrapper.cookie = callable
Wwise.load_bank_async_id(AK.BANKS.INIT, cookie_wrapper)
Wwise.load_bank_async_id(AK.BANKS.TESTBANK, cookie_wrapper)
func _bank_callback(data):
print(data)
Create a CookieWrapper
object and a Callable
. Assign the callable to the cookie
property of the wrapper. The callback function will receive information about the soundbank loading state. In the example above, it would be:
{ "bank_id": 1355168291, "result": 1 }
{ "bank_id": 3291379323, "result": 1 }
You should now have a good understanding of how to load banks in your Godot project.
- 4.1+
- 3.5
- Getting Started
- Tutorials
- Exporting projects
- GDNative Interfaces
- Custom Nodes
- Custom addons
- Wwise version upgrade
- Roadmap