How do you mute ALL audio on multiple levels?

Hello, I’m looking for a simple way to mute audio/music on every single level in my game.

My Main Menu level has an ‘options’ section where the 2 buttons are to control the audio (on and off).

The second level is the level which contains the audio (which i want to be able to mute and unmute), so for example in the character blueprint I’ve added in a ‘Play sound at location’ after ‘Event on jumped’. I’ve added a few other audio clips in this way.

I’ve seen online a few times about making sound mixers and then controlling them that way, but that only works if that is set up in the same level. My issue is I want the Main Menu level to control the audio for other levels.

I have an ‘instance’ set up I just don’t know how to hook it all up.

I am very new to all of this so please don’t feel bad to reply with very simple terms.

Many thanks!

Hi,

  1. First you need to setup your SoundClasses

275265-answerhub.png

master audio can have children if you want to mute just specific types of audio but with the parent (master), you can mute both.

  1. Next, make sure all audio cues have a sound class assigned.

  1. Create a Sound Mix and assign a SoundClass (Master so we can mute all audio)

  1. Blueprint code: check the image, You can do this inside your option widget and store the variable in a savegame like I did it (float or boolean) so the settings are saved for the next startup where you just push the current settings again. (the blue SG node is my savegame) If you don’t use savegame you can store variables for the play session inside your GameInstance which is consistent no matter which levels your player is in (but it’s not saved for the next play session). The default instance also needs to be set in the project Settings>Maps & modes

(This setup is a mute audio Toggle)

3 Likes