# GetMode error in sounds of programmer instrumment

**URL:** <https://qa.fmod.com/t/getmode-error-in-sounds-of-programmer-instrumment/23013>\
**Category:** Unity\
**Tags:** unity\
**Created:** [June 4, 2025, 7:39pm UTC](https://qa.fmod.com/t/getmode-error-in-sounds-of-programmer-instrumment/23013 "2025-06-04T19:39:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![basttian94](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@basttian94](https://qa.fmod.com/u/basttian94)\
**Post date:** [June 4, 2025, 7:39pm UTC](https://qa.fmod.com/t/getmode-error-in-sounds-of-programmer-instrumment/23013/1 "2025-06-04T19:39:05Z")

</div>

Hi everyone

Im geting the following error with sounds in my programmer instrumment.

[FMOD] Sound::getMode(0000001402AFEDD0:0) returned ERR\_INVALID\_HANDLE for SOUND (0x18C0CD2E9A8).  
UnityEngine.Debug:LogError (object)

Unlike in your code example, I’m keeping the event instance and only releasing the sound once it has finished playing. I had to customize this approach for my project, which is more complex than the example provided. I noticed that when following the code example as-is, I was accumulating a memory stack of sounds, so I had to do it in thias way.

One concern I have is whether these errors could potentially lead to a crash. That said, based on what I see in the profiler, the event appears to complete its lifecycle as expected, and the memory is being released properly, and the behaviour of the sunds in the game are good too. I already understand that is tryng to get that mode but the sound is already released, but searching for something parallel to isValid method for instances, I didn’t find anything similar for sounds. The version of FMOD in my project is 2.03.07

thanks for your attention.

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [June 6, 2025, 2:24am UTC](https://qa.fmod.com/t/getmode-error-in-sounds-of-programmer-instrumment/23013/2 "2025-06-06T02:24:34Z")

</div>

Hi,

Thank you for sharing the information.

> [@basttian94](#):
>
> [FMOD] Sound::getMode(0000001402AFEDD0:0) returned ERR\_INVALID\_HANDLE for SOUND (0x18C0CD2E9A8).  
> UnityEngine.Debug:LogError (object)

This error typically occurs when attempting to access a sound object that has already been released or is otherwise invalid. In the case of programmer instruments, this can happen if the `FMOD.Sound` is released before the associated `EventInstance` has completed its lifecycle.

> [@basttian94](#):
>
> One concern I have is whether these errors could potentially lead to a crash.

If `Sound::getMode` is called directly after `Sound::release` , it may return an error or in some cases, cause a crash. It’s important to avoid releasing the `FMOD::Sound` until the programmer sound destroy callback has been triggered.

> [@basttian94](#):
>
> I had to customize this approach for my project, which is more complex than the example provided.

Would it be possible to share some code snippets? That would help me better understand how you’re managing the lifecycle of the sound. Also, are you explicitly calling [`Sound::getMode`](https://fmod.com/docs/2.02/api/core-api-sound.html#sound_getmode), or is FMOD calling it internally?
