FMOD 2.02.18 bug report

If you replay the music before it fades out, it will not work.
instance playback state is stopped.

the sample code :

FMOD.Studio.EventInstance instance;
FMOD.Studio.EventDescription desc;
string eventPath = “event:/Music”;

// get event desc
desc = FMODUnity.RuntimeManager.GetEventDescription(eventPath);

// create instance
desc.createInstance(out instance);

// play muisc
instance.start();
WaitSeconds(1f);

// stop music (music fadeout length 1 seconds)
instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
WaitSeconds(0.1f);

// release instance
instance.release();
instance.clearHandle();

// create instance again
desc.createInstance(out instance);

// play muisc again
instance.start();

TODO : replay music will be not work. check the palyback state is stopped.

Hi,

Unfortunately, I’ve been unable to reproduce the issue you’re describing. If I create an event with an AHDSR modulation applied to the master track volume, with a release time of 1 second, and use the following C# script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RestartInstance : MonoBehaviour
{

    FMOD.Studio.EventInstance instance;
    FMOD.Studio.EventDescription desc;
    string eventPath = "event:/Music/Level 02";

    // Start is called before the first frame update
    void Start()
    {
        // get event desc
        desc = FMODUnity.RuntimeManager.GetEventDescription(eventPath);

        // create instance
        desc.createInstance(out instance);

        // play music
        instance.start();
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
        {
            instance.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

            // release instance
            instance.release();
            instance.clearHandle();

            // create instance again
            desc.createInstance(out instance);

            // play music again
            instance.start();
        }
    }
}

The old event instance stops and fades out over 1 second when I input return, while the new instance starts without issue.

Please give the script a try and let me know whether you still run into the issue.