ERR_EVENT_NOTFOUND for a Bus

In my FMOD project I’m getting a reference to a Bus with code like this:

if (!Check(RuntimeManager.StudioSystem.getBus(busName, out var bus), $"Failed to get output bus `{busName}` from FMOD."))
    return default;

This is failing with an ERR_EVENT_NOTFOUND error:

Failed to get output bus “bus:/Voice” from FMOD. FMOD Result: ERR_EVENT_NOTFOUND

The person testing this says that bus:/Voice is a valid bus (they’ve tested an earlier prototype using that bus name).

Apart from an invalis bus name, what could cause an ERR_EVENT_NOTFOUND error in this case?

This could happen if your Master.strings.bank file has not been loaded yet. You can also try to use the GUID (right click on the bus in your project and select “Copy GUID” and see if the game code can find that bus.

Is it possible for the the strings bank to not be loaded when the Unity events (Start/OnEnable) in the scene are running (e.g. it’s loaded asynchronously). This code is running almost immediately after the scene is loaded, so that could well be the problem if so.

It certainly could be the case, especially if Unity loads the scripts in an order you’re not expecting. You can place a check for if a bank has been loaded with RuntimeManager.HasBankLoaded().

https://www.fmod.com/resources/documentation-unity?version=2.02&page=api-runtimemanager.html#hasbankloaded

Thanks, I’ve modified the system to accept paths in the editor and to convert them at edit time to IDs. Hopefully that will prevent any problems with the strings bank not being loaded at runtime (it also acts as a bit of validation that the path even exists).