# Problem with stopping a snapshot

**URL:** <https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653>\
**Category:** FMOD Studio\
**Tags:** unity\
**Created:** [April 14, 2022, 12:15am UTC](https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653 "2022-04-14T00:15:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerrardflynne](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/gerrardflynne/32/3424_2.png) [@gerrardflynne](https://qa.fmod.com/u/gerrardflynne)\
**Post date:** [April 14, 2022, 12:15am UTC](https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653/1 "2022-04-14T00:15:18Z")

</div>

Hello guys.  
I’m constantly having problems with stopping a snapshot in my projects and I honestly fail to understand why.  
I have a simple pause game situation where I pause the events and want to smooth it out with nice fades by applying a snapshot. The thing is starting the snapshot works, but stopping doesn’t, so after I unpause the game, the events still aren’t heard.

The code is:

> ```
> private void PauseMusic(bool paused)
> {   
> SoundEvent.setPaused(paused);
> BackgroundMusicSoundEvent.setPaused(paused); 
> 
> if (paused)
> {
> SnapshotEvent = FMODUnity.RuntimeManager.CreateInstance("snapshot:/PauseGame");
> SnapshotEvent.start();
> isMusicPaused = true;
> }
> else 
> { 
> if (isMusicPaused)
> {
> SnapshotEvent.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
> SnapshotEvent.release();
> isMusicPaused = false;
> }
> }
> }
> 
> ```

and then I trigger the function like this:

> if (currentPlayer.Pause.Active) PauseMusic(true);  
> else PauseMusic(false);

Any help, please? 🙂

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [April 14, 2022, 8:00am UTC](https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653/2 "2022-04-14T08:00:47Z")

</div>

You seems to set pause on your events at the beginning and you never unpause them, or I am missing something?

---

<div class="post-metadata">

**Author:** ![gerrardflynne](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/gerrardflynne/32/3424_2.png) [@gerrardflynne](https://qa.fmod.com/u/gerrardflynne)\
**Post date:** [April 14, 2022, 10:22am UTC](https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653/3 "2022-04-14T10:22:01Z")

</div>

I’m unpausing it here in the second line, by triggering the function with _false_ argument:

> if (currentPlayer.Pause.Active) PauseMusic(true);  
> else PauseMusic(false);

Overall, that _else_ branch works, at least I’ve successfully tried Debug.Log there.

---

<div class="post-metadata">

**Author:** ![Alcibiade](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alcibiade/32/4284_2.png) [@Alcibiade](https://qa.fmod.com/u/Alcibiade)\
**Post date:** [April 14, 2022, 10:24am UTC](https://qa.fmod.com/t/problem-with-stopping-a-snapshot/18653/4 "2022-04-14T10:24:33Z")

</div>

Sorry, I hadn’t realized setPaused was taking a bool parameter.
