# ERR\_EVENT\_NOTFOUND for a Bus

**URL:** <https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589>\
**Category:** Unity\
**Created:** [March 28, 2022, 1:47pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589 "2022-03-28T13:47:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![martindevans1](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martindevans1/32/3052_2.png) [@martindevans1](https://qa.fmod.com/u/martindevans1)\
**Post date:** [March 28, 2022, 1:47pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/1 "2022-03-28T13:47:44Z")

</div>

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

```csharp
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?

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [March 28, 2022, 11:28pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/2 "2022-03-28T23:28:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![martindevans1](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martindevans1/32/3052_2.png) [@martindevans1](https://qa.fmod.com/u/martindevans1)\
**Post date:** [March 28, 2022, 11:30pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/3 "2022-03-28T23:30:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [March 28, 2022, 11:47pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/4 "2022-03-28T23:47:09Z")

</div>

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](https://www.fmod.com/resources/documentation-unity?version=2.02&page=api-runtimemanager.html#hasbankloaded)

---

<div class="post-metadata">

**Author:** ![martindevans1](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martindevans1/32/3052_2.png) [@martindevans1](https://qa.fmod.com/u/martindevans1)\
**Post date:** [March 30, 2022, 8:24pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/5 "2022-03-30T20:24:55Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![lgarczyn](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@lgarczyn](https://qa.fmod.com/u/lgarczyn)\
**Post date:** [May 11, 2023, 1:19pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/6 "2023-05-11T13:19:48Z")

</div>

How did you do this? There’s no editor API for buses and VCAs

Did you parse the string bank ?

---

<div class="post-metadata">

**Author:** ![martindevans1](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martindevans1/32/3052_2.png) [@martindevans1](https://qa.fmod.com/u/martindevans1)\
**Post date:** [May 11, 2023, 1:55pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/7 "2023-05-11T13:55:10Z")

</div>

I don’t remember the details of how this works, but it looks like this is the relevant code:

```csharp
private static string? BusID(string name)
{
    if (string.IsNullOrWhiteSpace(name))
        return null;

    var result = RuntimeManager.StudioSystem.getBus(name, out var bus);
    if (result != RESULT.OK)
        return null

    var result2 = bus.getID(out var id);
    if (result2 != RESULT.OK)
        return null;

    return id.ToString();
}

```

This is used in the editor to convert path names supplied by the user into IDs which are stored and used at runtime. I hope that helps!

---

<div class="post-metadata">

**Author:** ![lgarczyn](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@lgarczyn](https://qa.fmod.com/u/lgarczyn)\
**Post date:** [May 12, 2023, 8:15pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/8 "2023-05-12T20:15:15Z")

</div>

Wait, how is this used in Editor ? Any calls to the RuntimeManager outside of, well, runtime, gives me errors after errors

---

<div class="post-metadata">

**Author:** ![martindevans1](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/martindevans1/32/3052_2.png) [@martindevans1](https://qa.fmod.com/u/martindevans1)\
**Post date:** [May 12, 2023, 10:40pm UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/9 "2023-05-12T22:40:27Z")

</div>

As far as I can see there’s nothing special to it 😕

Here’s a very cut down example of what’s going on in my inspector:

```csharp
[CustomEditor(typeof(Something))]
class DemoInspector
    : UnityEditor.Editor
{
  private string _typing;

  public override void OnInspectorGUI()
  {
    _typing= EditorGUILayout.TextField(label, _typing);
    var id = BusID(_typing);

    if (id != null)
      DoSomethingWithId(id);
  }
}
```

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [May 19, 2023, 1:31am UTC](https://qa.fmod.com/t/err-event-notfound-for-a-bus/18589/10 "2023-05-19T01:31:56Z")

</div>

It’s likely that @martindevans1 is using an old version of FMOD for Unity, as we only added a warning when using `RuntimeManager` outside of runtime as of 2.02.11/2.01.20, which was released at the start of December 2022. You shouldn’t be making calls to `RuntimeManager` outside of runtime, as the Studio system object that is created won’t be released, and once you reach a total of eight created system objects, i.e eight calls to `RuntimeManager`, you cannot create any more system objects.

Instead, within the scope of your Bus path-to-ID function, you can create and initialize your own Studio system, load your bank(s), retrieve and operate on your Bus, and then release the system.
