# EventInstance.getPlaybackState doesn't retrieve PLAYBACK\_STATE.STOPPING

**URL:** <https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467>\
**Category:** Unity\
**Tags:** unity\
**Created:** [November 2, 2022, 8:44am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467 "2022-11-02T08:44:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![giresharu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/giresharu/32/4145_2.png) [@giresharu](https://qa.fmod.com/u/giresharu)\
**Post date:** [November 2, 2022, 8:44am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467/1 "2022-11-02T08:44:42Z")

</div>

AHDSR and fadeout is working.  
But playback\_state changed to STOPED immediately.

I want to make a coroutine to wait while previours music is stopping, then play next music to change music.

When will the playback\_state changed to STOPPING? And How can I detect the event is fadeout stopping?

unity version: 2021.3.8f1c1  
fmod api version: 2.02.09  
fmod studio version: 2.02.09

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [November 3, 2022, 3:11am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467/2 "2022-11-03T03:11:30Z")

</div>

Hi,

How many seconds have you got the `Release` option set to on your AHDSR modulator? This value is how long you can expect to receive `STOPPING` for e.g. 1 second up to 60. Could I also get a code snippet of how you are checking the `PLAYBACK_STATE`?

---

<div class="post-metadata">

**Author:** ![giresharu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/giresharu/32/4145_2.png) [@giresharu](https://qa.fmod.com/u/giresharu)\
**Post date:** [November 3, 2022, 7:30am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467/3 "2022-11-03T07:30:34Z")

</div>

It“s 3.4 seconds：  
 ![2022113-151600](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/9a07aa2b9d2f20b4b28db200222bf3956ab20790.jpeg)

this is my code in a class that Inherited StudioEventEmitter

```auto
		PLAYBACK_STATE state;

		void Update() {
			PLAYBACK_STATE newState;
			EventInstance.getPlaybackState(out newState);
			if (state != newState) {
				state = newState;
				Debug.Log(newState);
			}
		}

		public void Stop(bool allowFadeout = true) {
			AllowFadeout = allowFadeout;
			base.Stop();
		}

```

When I execute the Stop() function, console print:

```auto
STOPPED

```

😢

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [November 4, 2022, 4:33am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467/4 "2022-11-04T04:33:00Z")

</div>

Hi,

This does seem to be a bug, I have passed it on to our dev team to look into further. In the meantime a solution is in `StudioEventEmitter.cs` on lines 304 - 306, change `instance` to `EventInstance`.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![giresharu](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/giresharu/32/4145_2.png) [@giresharu](https://qa.fmod.com/u/giresharu)\
**Post date:** [November 4, 2022, 6:21am UTC](https://qa.fmod.com/t/eventinstance-getplaybackstate-doesnt-retrieve-playback-state-stopping/19467/5 "2022-11-04T06:21:05Z")

</div>

Thank you!
