Loading SoundBanks (24.1) - alessandrofama/wwise-godot-integration GitHub Wiki
The integration provides a custom node called AkBank
that allows you to select a user-defined 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 SoundBank to select it. Select when the SoundBank should be loaded/unload in the Load On
and Unload On
properties of the node.
Export a WwiseBank
variable in a script attached to a node and the Select Bank...
button will appear in the inspector. Select the desired SoundBank and load it by calling load
on the exported WwiseBank
:
extends Node
@export var bank : WwiseBank
func _enter_tree() -> void:
bank.load()
to unload a SoundBank, call unload
on the exported WwiseBank property:
extends Node
@export var bank : WwiseBank
func _ready() -> void:
bank.load()
await get_tree().create_timer(2).timeout
bank.unload()
You can also directly call the load_bank
function on the Wwise
singleton:
func _enter_tree():
Wwise.load_bank("TestBank")
To unload a bank, call unload_bank
:
func _enter_tree():
Wwise.unload_bank("TestBank")
You can load SoundBanks asynchronously by calling load_bank_async
extends Node
func _enter_tree():
Wwise.load_bank_async("TestBank", _bank_callback)
func _bank_callback(data):
print(data)
The callback function will receive information about the soundbank loading state. In the example above, it would be:
{ "bank_id": 3291379323, "result": 1 }
You should now have a good understanding of how to load banks in your Godot project.