Tip: Audio Mixer level/volume control for Master, SFX and Music

What I want:
In Unreal 5.3, control the volume/levels of my Master (everything), SFX and Music separately.

I dug the internet a lot trying to find a bull’s eye solution for this.
There are great docs/videos about the Audio Mixer, Sound Class, Submixes, etc but I couldn’t find something that ties them all into what I want.
Ps: I’m a Unreal newbie :laughing:

With my research, I found a video that explained part of the solution so I could learn more about everything and create my solution.

So, here is the step-by-step, I won’t explain how to create a slider etc, I will just show how to organize and have the entries like “master volume”, “sfx volume” etc

Step by step:

First, the Sound Class:

  • This class we use to cascade (hierarchy) our audio controls. So let’s start creating the father class:
  • In the Content folder, create a Sound Class named MasterSoundClass
  • Open in → Windows → Graphs
    • Drag 2 children’s pins and names them SFXSoundClass and MusicSoundClass
      • Unreal will create 2 files in the same folder
  • Now, select your audio assets and assign the soundclass to them
  • E.g: To “batch” set, select all your sfx audio assets, right-click, edit, and set the Sound Class to SFXSoundClass
    • Now, all these audio assets volumes will be “directed” by the SFXSoundClass
      • And the Master volume controls them all because it’s the parent
  • Do the same for the music audios

image

Now, for testing:

  • Drag some of your SFXs and Music audios to a map
  • Open the SFXSoundClass and set the volume to 0.1
  • Play the map and check that all SFXs audios volumes are lower
  • Set the MasterSoundClass volume to 0.5, everything will be lowered down

So, a Sound Class, when assigned to an audio, the audio will follow the class values in a hierarchized way.

Now, how to change those values “dynamically” using Blueprints?!? :thinking: :thinking: :thinking:

The Sound Class Mix:

Create 3 Sound Class Mix:

  • MasterSoundMix
  • SFXSoundMix
  • MusicSoundMix

Open each one and add your sound classes accordingly.

  • MasterSoundMix → MasterSoundClass
  • SFXSoundMix → SFXSoundClass
  • MusicSoundMix → MusicSoundClass

You can add more classes to “mix them” together, but let’s keep it simple.

Now the Blueprint, for this, I did in my GameMode BP graph

The Set Sound Mix Class Override and Push Sound Mix are the saviors!! :pray:
Set each one for Master, SFX, and Music like the picture, changing the values to the correct sounds and mix classes.

The “Volume” pin in the Set Sound Mix Class Override will change the volume at Runtime, you can use a slider or wherever to change those values.

Problem solved! :clap: :clap: :clap:

The video that helped me a lot! Praise this guy!
How to Make a Simple Volume Slider in Unreal Engine 5 (youtube.com)

Ps: Unreal already has a built-in Master, SFX, Music sound classes but I couldn’t find the hierarchy on it, so I decided to create my classes with different names to not confuse myself.

16 Likes

Superb write up. I was able to implement sound setting sliders with this, thanks!

Thank you for this!

This works perfectly, thanks! Very elegant implementation

For anyone who would find this thread, here are a few important notes:

  1. Function “Push Sound Mix Modifier”, as the name suggests, pushes the modifier into the stack/array (I didn’t check the implementation), if you do it every time you change volume, you will end up with a lot of references in the system. I didn’t do research how it impacts the performance but here’s how to prevent it:
    • Use console command “au.Debug.SoundMixes 1 -AllViews” to check currently active sound mixes.
    • At initialization (by definition it should be called once, but you never know) of your game or your sound manager: call “Clear Sound Mix Modifiers” (to prevent mistakes) and then call “Push Sound Mix Modifier” for every Sound Class Mix, i.e. master, music, sfx. Make sure your game calls the initialization once (you might need to repeat it after changing levels, but I didn’t check).
    • Now, during gameplay, whenever your audio settings change, you can now call “Set Sound Mix Class Override” as many times as you want for specific mix classes, like music, sfx or master and it should work by itself.
    • It is not needed for a simple volume controls, bonus info: there’s also a pop function if you need to push/pop specific mix classes during gameplay. You don’t have to do it in blueprints all the time though, check very useful list of “passive sound mix modifiers” with automatic push/pop options (in the sound classes).
  2. Check “Apply to Children” in sound mixes that contain children, like the master mix. I didn’t test if it’s necessary but it works on my side so I’d recommend it.

Happy developing!