Make Audio Settings in Blueprints

Good Day,

I’m wanted to add in an Audio Setting into my Game. The way I want it to work is using simple Buttons that need to be pressed rather than using a Slider.

Would anyone know whether this can be done by using an OnPressed Function then using a ConsoleCommand?
What is the ConsoleCommand to control Global Audio?

Any help will be greatly appreciated.

Thank You Kindly

You should use Audio Classes, and have your cues be children of that class. Then you can change the audio class volume, and it will propagate to all children.
You can use the UMG Up and down widgets to increment and decrement the value you pass to the sound class.

I recommend reading about the Unreal Audio System:

I was going to post an answer, but @BenVlodgi beat me to it, and answered more succinctly. But here’s my message in case it’s helpful:

You can absolutely control your game’s volume using UMG buttons and OnPressed events. However, as for what code or scripting to execute when the button is clicked, that depends on how you want to set up your project.

As far as I know, there’s not a built-in global audio volume setting that can be manipulated via Blueprint scripting. This means you’ll have to think about building some kind of system for your game that allows you to adjust your game’s volumes (perhaps by individual categories) during runtime. This will almost certainly involve the use of Sound Class and Sound Mix assets (link), but there’s probably not a single ‘right’ answer for how to get it done. It just depends on your project’s needs.

In your case, your buttons would, in their OnPressed functions, call up some other functions to make modifications to the volumes of Sound Cues or, more likely, Sound Mixes.

You might want to check out this excellent audio tutorial on raywenderlich.com. It doesn’t cover the use of buttons for controlling audio volume, but it shows how to combine all sorts of audio-related assets into one project. It has helped me understand UE4’s audio system at least as well as the official docs have.

well said :slight_smile: