Search code examples
fmod

FMOD Get Parameter OK, Set Parameter ERR_INVALID_PARAM


I have code that gets a parameter and then sets a parameter. The get works fine, but the set returns ERR_INVALID_PARAM:

            FMOD.RESULT getResult = FMODManager.GetCurrentMusicInstance().getParameterByName(PianoVolumeParamter, out pianoParameter);
        Debug.Log("Get Result " + getResult);

        FMOD.RESULT result = FMODManager
            .GetCurrentMusicInstance()
            .setParameterByName(PianoVolumeParamter, 1f);
        Debug.Log("Set Result " + result);

What am I doing wrong? This is FMOD for Unity 2.01.07. The max value for PianoVolume is 1f, the min is 0f. It's a continuous parameter.


Solution

  • So I'd accidentally set the parameter type to Global and you can't change Global parameters this way. Totally my mistake.