Calling FMOD StudioEventEmitter from code is always playing the first value of Parameter list

I’m having an issue when working with FMOD 2.02.07 for Unity 2022.1.1f1.

Our sound designer has implemented music and SFXs for the project, but I am experiencing some weird issue when playing the latters, and I guess it has to do with my setup in Unity, or code behaviour. There are two different scenarios going on:

First, for specific audio effects for one “minigame”. In it, there is only one StudioEventEmitter component, and for each action of the card minigame (drawing a card, placing it on the table, etc.) I play a different sound of that event’s pool, but when doing so the EventEmitter is playing two sounds at once (the one I played and the 0 value of the parameter’s list) overlapping them. I have recorded a video capture explaining it and showcasing the problem so you can have a better understanding of the situation:

· Multiple sounds overlapping 2

Also, another problem I’m having has a different outcome, but I feel that it might still be related. When moving the main character, we play in its own StudioEventEmitter some sounds of steps, different when it is walking or running. It is mostly working as intended, but every time we switch from Walking to Running, the first running step still plays the walking sound, and then updates correctly and keeps playing the correct running sounds. Again, I have recorded this behaviour with a short explanation:

· Sound value restarting 1

In both cases, the first sound value of the parameters’ list of that particular event is the one causing the trouble, so I’m guessing it is somehow related. Both are using the same code from the same MonoBehaviour class.

Can someone please help me figuring out what could be wrong there? I’m quite sure that it must be an error on my side, I guess I’m not configuring things properly.

Thanks in advance.

Hi, with the multiple sounds overlapping it sounds like it is being called twice within the code. However, this can be fixed without any changes to the technical implementation. Fmod has a feature called stealing and event instancing, by setting the event to a maximum instance of one and setting the stealing to oldest, this will ensure that only one sound plays at a time, if two trigger the newest instance will kill the previous one (Different stealing types available).

For your parameter issue are there multiple instances of the fmod event? If so, it sounds like the parameter type is local, therefore each instance will maintain its own values for each event. If you want the parameter to be shared through different event instances use a global parameter.