# EventEmitter IsPlaying() returning true after calling Stop()?

**URL:** <https://qa.fmod.com/t/eventemitter-isplaying-returning-true-after-calling-stop/21774>\
**Category:** Unity\
**Created:** [June 17, 2024, 10:35pm UTC](https://qa.fmod.com/t/eventemitter-isplaying-returning-true-after-calling-stop/21774 "2024-06-17T22:35:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![willerdasilva-aristo](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@willerdasilva-aristo](https://qa.fmod.com/u/willerdasilva-aristo)\
**Post date:** [June 17, 2024, 10:35pm UTC](https://qa.fmod.com/t/eventemitter-isplaying-returning-true-after-calling-stop/21774/1 "2024-06-17T22:35:41Z")

</div>

I’ve been confused with event emitter for a while now in regards to this. If you’ve played from a `StudioEventEmitter` and then after that `StudioEventEmitter.Stop()` is called before `StudioEventEmitter.IsPlaying()` within the same frame, for some reason `StudioEventEmitter.IsPlaying()` returns true?

Is there something I’m misunderstanding about how stopping works? Is there a better way to completely reset the state of an event emitter before hitting play again?

---

<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:** [June 18, 2024, 1:50am UTC](https://qa.fmod.com/t/eventemitter-isplaying-returning-true-after-calling-stop/21774/2 "2024-06-18T01:50:06Z")

</div>

Hi,

The [Stop()](https://fmod.com/docs/2.02/unity/api-studioeventemitter.html#studioeventemitter_stop) function utilizes the current `Allow Fadeout When Stopping` value assigned in the emitter’s `Advanced Controls`:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/35fab056becd5409baff7207e70c676fda497458.png)

`IsPlaying()` may return true because the event is still fading out. If you have `Allow Fadeout` enabled, could you please try disabling it and let me know if the issue persists?

As an alternative, consider using [Studio::EventInstance::getPlaybackState()](https://fmod.com/docs/2.02/api/studio-api-eventinstance.html#studio_eventinstance_getplaybackstate). This function provides a more detailed state of the event instance. Here’s an example to check the current state:

> **Check current state example**
>
> ```auto
> public FMODUnity.StudioEventEmitter emitter;
> 
> private FMOD.Studio.PLAYBACK_STATE currentState = FMOD.Studio.PLAYBACK_STATE.STOPPED;
> 
> // Update is called once per frame
> void Update()
> {
> emitter.EventInstance.getPlaybackState(out currentState);
> Debug.Log($"Instance state is: {currentState}");
> 
> if (Input.GetKeyDown(KeyCode.Escape))
> {
> emitter.Stop();
> }
> 
> if (Input.GetKeyUp(KeyCode.Space))
> {
> emitter.Play();
> }
> }
> 
> ```

> [@willerdasilva-aristo](#):
>
> Is there a better way to completely reset the state of an event emitter before hitting play again?

Disabling the `Allow Fadeout` option should immediately return true from `IsPlaying()`. However, if you prefer to keep fadeout enabled for your events, using `getPlaybackState()` might be a better solution.

Hope this helps
