Loading banks from code, and reading info about the bank

Hi, I’m trying to load my banks from code and get information about them. I’m using Unity 2022.3.20f1 with fmod studio 2.02.24.

I have a VCA set up from the studio and when I try to get it I just get the error ERR_EVENT_NOTFOUND. So I thought I’d read the bank file to check if it’s even in there but it’s not human readable.
The next approach would be to get the loaded bank and then use getVCAList() on it. This seems to work but vca.getPath() returns null. Also ERR_EVENT_NOTFOUND.

My integration is the same as StudioBankLoader which is basically:

[SerializeField] [FMODUnity.BankRef] private string _bank;

void Start() {
    FMODUnity.RuntimeManager.LoadBank(_bank);
            FMODUnity.RuntimeManager.WaitForAllSampleLoading(); // the bank loads succesfully
            var bankListResult = FMODUnity.RuntimeManager.StudioSystem.getBankList(out var bankArray); // This works fine
            if (bankListResult != FMOD.RESULT.OK) Log.Error("Couldn't get bank list from StudioSystem: " + bankListResult);

            foreach (var bank in bankArray) {
                var bankPathResult = bank.getPath(out var path); // path is null and result is the event not found error, but the bank does exist
                if (bankPathResult != FMOD.RESULT.OK) Log.Error("Couldn't get bank path: " + path + ". Err: " + bankPathResult);
                var bankVcaListResult = bank.getVCAList(out var vcaList); // this one is fine too
                if (bankVcaListResult != FMOD.RESULT.OK) Log.Error("Couldn't get vca list from bank: " + bank + ". Err: " + bankVcaListResult);
                foreach (var vca in vcaList) {
                    var vcaPathResult = vca.getPath(out string vcaPath); // again this path is null and returns the event not found error, but it exists in the list...
                    if (vcaPathResult != FMOD.RESULT.OK) Log.Error("Coulnd't get vca path: " + vcaPath + ". Err: " + vcaPathResult);
                    Log.Info("VCA: " + vcaPath);
                }
            }
}

Maybe worth noting: I’m using perforce as version control, I have a feeling that the readonly files might be a cause. I also assume that getPath returns something like vca:/MyVCA

If anyone has any ideas on why getPath() is failing I’d really appreciate it. Or if there are other ways to read the bank data or load them I’d also love to hear about it.

Hi,

Which is the bank you are passing in the _bank?

The issue may be that the Master.strings.bank has not been loaded. The strings bank is required to use Path’s. More info on the strings bank can be found here: FMOD Engine | Glossary - Studio Strings Bank.

Hope this helps!

1 Like

It was exactly this.

Now I first load the master bank, and then in the same way I load the master.strings bank. I’m not sure if they have a different way to be loaded but this did fix it.
I was mostly confused because I also had some events playing so I ruled out the string bank :sweat_smile:

1 Like

Good to hear that solved the issue!

How were these events being triggered?

Would it be possible to get a screenshot of your integration settings?
image