# How To Stop Fmod Event Audio When Switching Levels

**URL:** <https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796>\
**Category:** Unreal Engine\
**Created:** [May 21, 2020, 12:35am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796 "2020-05-21T00:35:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasiomusic](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jasiomusic](https://qa.fmod.com/u/jasiomusic)\
**Post date:** [May 21, 2020, 12:35am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796/1 "2020-05-21T00:35:49Z")

</div>

Hi, i’m trying to figure out how to get an event to stop playing when a player triggers a level change in game via a trigger volume. Using Blueprints in ue4.

I am triggering an ambient music track when the level loads by triggering “Play Event 2D” and selecting my event in an audio blueprint I have sitting in the level.

 ![Screen Shot 2020-05-20 at 6.30.02 PM](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/786acd9342def1d0624a61de9b70bd92a3d5d5aa.png)

the player then gets to enter the next level via a portal in this level, this is achieved using a trigger volume with “on player overlap” code getting triggered.

Currently when the player does this, this level music just keeps playing. The next level loads, that levels music starts playing as well, and it all turns into a mess.

I need to stop the first level’s music during that trigger volume overlap so that i can transition into loading screen audio, and finally the next level. My problem, is that when I try to use an “Event Instance Stop” function in the logic to try and do this, I don’t know how to reference the correct Event Instance, ie the music I triggered to start when the level started. I want to reference the same ‘Level\_0\_Hub’ event that I started at begin play.

 ![Screen Shot 2020-05-20 at 6.30.32 PM](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/d0dd44b76c089fad3423abb0782966a1b5b6b3d2.png)

I notice the only “stop” audio function refers to an fmod audio component rather than an event. I’m fairly new to implementation so I’m still trying to learn what some best practices are to doing stuff like this. seems like im missing something simple but i’m having a hard time finding a way forward that works.

Any advice? Thanks in advanced.

---

<div class="post-metadata">

**Author:** ![jasiomusic](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jasiomusic](https://qa.fmod.com/u/jasiomusic)\
**Post date:** [May 21, 2020, 12:55am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796/2 "2020-05-21T00:55:16Z")

</div>

just an update, I’m able to force the functionality of getting the audio to stop playing by calling “Unload Bank” and unloading my level bank on the overlap event. this will work for now i think, but I’d like to be able to possible fade audio out into the load screen, have load screen audio fade in, etc… As well as use the other Event Instance controls available.

what would be the best way to implement that / get the event reference in another blueprint?

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 25, 2020, 2:16am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796/3 "2020-05-25T02:16:45Z")

</div>

You can use the Unreal Engine’s method of referencing one blueprint in another blueprint, but it would be best to visit the UE4 forums to ask on the best way to do this.

In regards to unloading a bank - this will automatically stop and unload any events assigned to this bank, however you will lose control over behaviours such as fade-out etc. if you do this way. It would be more graceful to properly call a stop on the events no longer needed in the level.

---

<div class="post-metadata">

**Author:** ![jasiomusic](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jasiomusic](https://qa.fmod.com/u/jasiomusic)\
**Post date:** [May 28, 2020, 2:58am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796/4 "2020-05-28T02:58:11Z")

</div>

thank you. at the time i was having a hard time getting the “stop instance event” function to work properly for me but now I think it’s doing fine. That’s still a hard cut though, if I wanted it to fade out what would be the best approach? I’ll do my own research but if you happen across this feel free to respond.

when I first wrote this I wasn’t hip to the idea of using ‘set event’ to get an event to turn into a component, giving you access to a host of more controls over it so my guess is I can find my answer in there somewhere.

i appreciate your time.

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [May 29, 2020, 1:58am UTC](https://qa.fmod.com/t/how-to-stop-fmod-event-audio-when-switching-levels/15796/5 "2020-05-29T01:58:02Z")

</div>

You can add an AHDSR modulator to the volume fader on the master track of the event. Then when you call stop on the event you can pass the allow fade out flag to have the event fade out.

For example:  
`eventInstance.stop(FMOD_STUDIO_STOP_ALLOWFADEOUT)`
