Send automation curve from fmod to unity

(Giori Politi) #1

Is there a way to send automation curve from an fmod event to unity for controlling game parameters?

The only way i found was to create an audio channel with a static sound, automating the level of it and send it to a parameter’s side chain. Then i was able to read the parameter value in unity.

It works, but little expensive in resources if i need to run many instances together.

is there a more straightforward way doing this?



(Cameron Baron) #2

Just to clarify, you want to automate something in Studio and get the value of that in Unity to drive something in the game?

(Giori Politi) #3

Yes, exactly.

(Cameron Baron) #4

At the moment that is the only way to get an automated value out of an event. Some built in properties are accessible through EventInstance::getProperty, although those don’t really fit into this purpose.

Using getParameterByIndex is cheaper than using getParameterValue, which uses a string lookup. As long as you already know the index of parameter you need, which you could cache earlier from the EventDescription.

We do have plans to make this easier/cheaper but those changes aren’t currently on the roadmap.

(Giori Politi) #5

Thanks Cameron.

Regarding the side chain method,
I am using a dedicated 1kHz sine wave and automating it’s gain for creating the envelope. This is sent to the parameter’s side chain pre track fader.
If i set the track’s volume to minimum (I don’t want this sound to be a part of the mix), then in the build it doesn’t work (I assume because Fmod knows no sound is coming out so disabling the track).
So what i do is set the volume to -79 dB in order for it to work.

Is theres a way to set the volume to minimum but still force the sound to play?


(Cameron Baron) #6

Setting the events priority to ‘Highest’ should cause all voices in the event to never virtualize.

(Giori Politi) #7