What is the best practice for Unloading Banks, and when would I need to use it?

It seems like a pretty obvious question, but as I have been exploring the API I’ve just wondered what the purpose is of unloading banks, when I could just use release() to stop sound objects in the scene. Does the data from a bank remain in the scene even if nothing is playing? The way I have experimented was to make a gameobject and attach a bank loader component to it, then go in to an enemy footstep script and write a public ‘[EventRef]SoundBankLoader music;’ variable, I then call music.Invoke(); in my footstep function. This gives me a dialogue box I place my gameobject with bank component in. This worked, and was cool, but would like to know if there is more high level reasons to use this? or is there a better way to do it?

It allows you to have control over available resources. If you have large or a lot of banks, you may not want them all to be loaded all of the time.

You can have a dedicated bank that only contains sounds for a specific scene, that way if you are not using the scene you do not need to have it loaded.

Basically if you aren’t using the sounds in a bank then there is no need for it to be loaded. But it is always best to load banks well before they are required, to avoid any delays caused trying to play a sound that is being loaded.

1 Like

Thanks @cameron-fmod that explains it for me.

Do I have to unload all banks when the game ends? I noticed in Unreal Engine 5 PIE that fmod sometimes cannot build certain banks as the files are locked by unreal, although PIE just ended.

Best regards

You should not need to unload banks when your game ends, as long as release is called on the Studio System (which occurs when PIE ends) the banks will be automatically unloaded.

Are you manually loading banks at all?
What is locking the banks? Are they loaded by FMOD or is it something like source control locking them?