Get parameter value inside unity


I’m new to fmod but fairly experienced in Unity. A simple question, but getting my head around it all the time.

I have a StudioEventEmitter called ‘boatSoundController’ and a parameter called ‘boat_movement’. I need to constantly receive values of ‘boat_movement’ so that I can pass it on to other floats in Unity.
Is there a way I can see the parameter value during runtime? I can see the initial parameter value in the event, but not it’s constantly updated value!

Any help would be much appreciated. Thanks.

You would have to do this in your own script.

You will want to get the EventInstance from the StudioEventEmitter.

Or you can create and control an Event from your own script, where you would also have direct access to the Instance.
Here is an example of how you can use FMOD in a script:

Once you have the EventInstance you can call EventInstance::getParameterValue whenever you need the current value.

Thank you, it worked out very well :slight_smile:

This feels very complicated. I’m trying to simply tween a volume and digging into this things feels like a waste of time. Why not simply have access to a GetParameter method?

You can access the EventInstance of a StudioEventEmitter and call getParameter() directly on that.
We just haven’t had any requests for that sort of helper function previously.