# Error: Event not found when using Studio::System::lookupPath

**URL:** <https://qa.fmod.com/t/error-event-not-found-when-using-studio-lookuppath/20244>\
**Category:** FMOD Engine\
**Tags:** html5, javascript\
**Created:** [May 22, 2023, 3:13pm UTC](https://qa.fmod.com/t/error-event-not-found-when-using-studio-lookuppath/20244 "2023-05-22T15:13:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LISCaspar](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@LISCaspar](https://qa.fmod.com/u/LISCaspar)\
**Post date:** [May 22, 2023, 3:13pm UTC](https://qa.fmod.com/t/error-event-not-found-when-using-studio-lookuppath/20244/1 "2023-05-22T15:13:24Z")

</div>

Hi.

Recently I started learning how to use the FMOD API for my HTML5 project, but I am running into some problems.

I am trying to use the [Studio::System::lookupPath](https://www.fmod.com/docs/2.02/api/studio-api-system.html#studio_system_lookuppath) function, but I keep getting the “Event not found” error when using it.

Here’s what my code looks like:

> toPathFromGuid : function(guid) {  
> let pathBuffer = new Uint8Array(256);  
> let retrievedSize = pathBuffer.length;  
> let result = FMOD.ERR\_TRUNCATED;
> 
> ```
> do {
> result = gSystem.lookupPath(guid, pathBuffer, retrievedSize, retrievedSize);
> }
> while (result === FMOD.ERR_TRUNCATED);
> 
> return new TextDecoder().decode(pathBuffer.subarray(0, retrievedSize - 1));
> }
> 
> ```

My first guess was that the banks simply weren’t loaded correctly, so I tried it out by playing a sound trough looking up an EventDescription using the `Studio::System::getEvent` function.

This does seem to work, which should mean that the bank is loaded correctly.

Later, I also tried the Studio::System::getBankList function, but this returned an empty array.

To load the banks I followed the FMOD [load\_banks](https://www.fmod.com/assets/html5/studio_api/load_banks.html) example code, using the Studio::System::loadBankFile function.

Thanks in advance for the help.

---

<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 23, 2023, 4:29am UTC](https://qa.fmod.com/t/error-event-not-found-when-using-studio-lookuppath/20244/2 "2023-05-23T04:29:19Z")

</div>

Hi,

Are you certain that you’re loading your master banks? `System.lookupPath` in particular requires the master strings bank to be loaded. The `load_banks` HTML5 Studio API example doesn’t ever actually load the master banks, so if you’ve copied the code from that example then you may not have loaded them.

If you have loaded all of your banks appropriately, could I get you to provide your FMOD version number and which backend compiler you’re using?

---

<div class="post-metadata">

**Author:** ![LISCaspar](https://avatars.discourse-cdn.com/v4/letter/l/5f8ce5/32.png) [@LISCaspar](https://qa.fmod.com/u/LISCaspar)\
**Post date:** [May 23, 2023, 8:30am UTC](https://qa.fmod.com/t/error-event-not-found-when-using-studio-lookuppath/20244/3 "2023-05-23T08:30:28Z")

</div>

Thanks for the reply!

After looking more into it, I realized I was checking for loaded banks wrong. All banks, including the Master.strings bank were loaded correctly.

After more testing I have figured out exactly what went wrong in my code, the `lookupPath` function was working as intended, but I was handling my `pathBuffer` variable wrongly.

I tried to decode it, like this:  
`return new TextDecoder().decode(pathBuffer.subarray(0, retrievedSize - 1));`

While all I needed to do was do this:  
`return pathBuffer.val;`

It’s working now! 😅
