# Getting ERR\_INVALID\_HANDLE when trying to play sound

**URL:** <https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404>\
**Category:** Unity\
**Created:** [March 24, 2016, 7:26pm UTC](https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404 "2016-03-24T19:26:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliran](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@oliran](https://qa.fmod.com/u/oliran)\
**Post date:** [March 24, 2016, 7:26pm UTC](https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404/1 "2016-03-24T19:26:54Z")

</div>

Hi,

In my game, I have a Studio Bank Loader that loads bank for that scene at the beginning of scene and unloads at end of scene. In the next scene, I also have a Studio Bank Loader which loads the bank for that scene. However, if the same event is in two banks (for scene 1 and scene 2), the scene 2 won’t start(). Calling start() the first time returns OK but no audio is heard and PLAYBACK\_STATE is STOPPED. When I try to call start() again, I get ERR\_INVALID\_HANDLE.

I am sure that the banks are set up correctly. Possibly of importance is that I also have another Studio Bank Loader in a singleton object that loads Music bank (so that music can continue playing nonstop across scenes).

One other clue: any event that wasn’t loaded in previous scene works fine… Just not same events. Which doesn’t really make sense to me since previous bank should be unloaded and new one loaded.

At this point I really tried everything I could think of and I can’t think of any other clues to fix this.

UPDATE: I fixed it! But solution is more puzzling to me than original problem. The solution was to take out ALL Studio Bank Loaders. However, sound still plays and now no errors with RESULT! How?? How are events being loaded without the bank loaded?? Did something change in latest fmod version? In the past it used to crash when I tried to do that. Now, loading banks makes it not work.

Thank you,  
Omer

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [March 29, 2016, 12:20am UTC](https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404/2 "2016-03-29T00:20:47Z")

</div>

If you’ve updated from the Legacy to the V2 integration then the loading strategy has changed. On the settings there is a option (on by default) to load all Banks at startup.

Check your loadBank function calls and look for EVENT\_ALREADY\_LOADED return code.

If you have an EventDescription or EventInstance objects and you unload/load the banks then the isValid() function will return false and any other function calls will return INVALID\_HANDLE.

---

<div class="post-metadata">

**Author:** ![oliran](https://avatars.discourse-cdn.com/v4/letter/o/a8b319/32.png) [@oliran](https://qa.fmod.com/u/oliran)\
**Post date:** [March 29, 2016, 6:32pm UTC](https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404/3 "2016-03-29T18:32:36Z")

</div>

> [@](#):
>
> If you’ve updated from the Legacy to the V2 integration then the loading strategy has changed. On the settings there is a option (on by default) to load all Banks at startup.
> 
> Check your loadBank function calls and look for EVENT\_ALREADY\_LOADED return code.
> 
> If you have an EventDescription or EventInstance objects and you unload/load the banks then the isValid() function will return false and any other function calls will return INVALID\_HANDLE.

Thanks for the clarification! Is there any downside to loading all banks at startup? It doesn’t actually use RAM until I load the sounds ie. with CreateInstance(path), right?

---

<div class="post-metadata">

**Author:** ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)\
**Post date:** [March 29, 2016, 11:37pm UTC](https://qa.fmod.com/t/getting-err-invalid-handle-when-trying-to-play-sound/12404/4 "2016-03-29T23:37:42Z")

</div>

It uses some memory to load the event metadata, but the bulk of the memory consumed by a bank is the sample data (which can be set to load up front as well in the settings).
