Hey friends!
Someone at our company previously wrote a wrapper to handle our connection to FMOD. I’m not quite used to working this way, so it’s taken me some time to get into replacing functions and updating our FMOD. We were on 1.04 and are now finally on latest, however ParameterInstance has deprecated, leaving me high and dry when it comes to working out how to change parameters.
Here is our wrapper as it stands (no longer working)
public class AudioParameter
{
FMOD.Studio.EventInstance _parameter;
string _parameterName;
public float value
{
get
{
FMOD.RESULT result = _parameter.getParameterByName(_parameterName, out float v);
if (result != FMOD.RESULT.OK)
{
Debug.LogErrorFormat("FMOD: Failed to get parameter: {0}", result);
return 0;
}
return v;
}
set
{
//Deprecated from 1.10
//FMOD.RESULT result = _parameter.setValue(value);
FMOD.RESULT result = _parameter.setParameterByName(_parameterName, value);
if (result != FMOD.RESULT.OK)
Debug.LogErrorFormat("FMOD: Failed to set parameter: {0}", result);
}
}
internal AudioParameter(FMOD.Studio.EventInstance parameter)
{
_parameter = parameter;
}
}
However, we of course get a “FMOD: Failed to set parameter: ERR_INVALID_PARAM” error because, I’d assume, I’m not calling these functions correctly.
Can anyone please enlighten me as to how I can adapt this wrapper to get parameters working?
We normally call them like this;
AudioParameter uiHoldPosition;
uiHoldPosition.value = Progress
Thank you technical saviours!