GetMode error in sounds of programmer instrumment

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.

Hi,

Thank you for sharing the information.

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.

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.

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, or is FMOD calling it internally?