Fmod working in unity editor but not on build (banks not found, StreamingAssets folder not created)

My project is correctly working in the Unity editor, but once I build it I get the following errors:

[FMOD] RuntimeBankModel::openFile : Failed to open file ‘[…]Project_Data/StreamingAssets\Audio/FMODBanks/’

BankLoadException: [FMOD] Could not load bank ‘[…]Project_Data/StreamingAssets\Audio/FMODBanks/’ : ERR_FILE_NOTFOUND : File not found.

And indeed, the folder StreamingAssets is not to be found under data.

The strange thing is I am not using the “StreamingAssets” import type, but the “Asset Bundle”.

Here are my Bank Import settings:

The banks are loaded with the FMOD Studio Bank Loader:

I am using Unity 2021.1.3f1 with the FMOD Unity plugin 2.02.00 and FMOD 2.02.00.

Any idea why this is happening?


The problem is that the FMOD Studio Bank Loader isn’t designed to load Asset Bundles so you will need to make a custom bank loader. We have an example on how to do this, then to load Asset Bundles you would need to change the loading loop to:

foreach(var bank in Banks)
    TextAsset textAsset = Resources.Load("Audio/FMODBanks/" + bank) as TextAsset;
    FMODUnity.RuntimeManager.LoadBank(textAsset, true);

To be able to use Resources.Load will require you change your FMOD Asset Sub Folder in FMOD Settings to “Resources/Audio/FMODBanks”. Then you just need to swap out the FMOD Studio Bank Loader with your custom one and it should build fine.

Thanks, got it.

Changing the setting to Streaming asset made the issue go away. I was using the asset bundles because I needed the low latency for changing the cursor position (read that somewhere), but I’m not doing that anymore, so I switched back to streaming assets.

I have another issue where Fmod works in the editor but not when compiled now, but I will open a new thread.

Thanks for your help!