SetParameterValue is applied not immediatley

Hello, using FMOD Studio API I faced a problem in the following situation. In our game when we need to reload game we show loading screen and stop and release all playing looping events in fading manner. Since loading has been completed we start playing these looping events again from the beginning. And one of the events should be started with parameter being set. For the event first we call createInstance(), then start() and then setParameterValue(). All three actions are called on the same game frame. But the behaviour of how the event is played seems strange. First 1-1.5 seconds it is played like the parameter has not been set and only then it starts playing like parameter is set. It works fine with the following sequence createInstance()->setParameterValue()->start(). But is it possible to make it work in createInstance()->start()->setParameterValue() order?

There are some more tests that I’ve made:

  1. Before creating instance of the event after reload I check number of instances by getInstanceCount() function call and it shows 0. The result is expected since previous instance has been already released.
  2. I set callback for the event to catch FMOD_STUDIO_EVENT_CALLBACK_DESTROYED to define the moment when the event is released. And as expected FMOD_STUDIO_EVENT_CALLBACK_DESTROYED is caught before new instance is created.
  3. The event with parameter being set is played in proper way if I’ve just started the game, i.e. if there was no stopping/releasing actions to the event.
  4. Also unloading+loading bank helps to play the event with parameter being set in proper way. But we would like to avoid such a solution.

I would appreciate your help.


The problem has been solved from sound design side.

1 Like