# FMOD 2.02.18 bug report

**URL:** <https://qa.fmod.com/t/fmod-2-02-18-bug-report/20913>\
**Category:** Unity\
**Tags:** unity\
**Created:** [November 28, 2023, 3:57am UTC](https://qa.fmod.com/t/fmod-2-02-18-bug-report/20913 "2023-11-28T03:57:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hevinci](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hevinci](https://qa.fmod.com/u/hevinci)\
**Post date:** [November 28, 2023, 3:57am UTC](https://qa.fmod.com/t/fmod-2-02-18-bug-report/20913/1 "2023-11-28T03:57:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [November 29, 2023, 2:55am UTC](https://qa.fmod.com/t/fmod-2-02-18-bug-report/20913/2 "2023-11-29T02:55:24Z")

</div>

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:

```auto
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.
