x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.19
Tags:
more ▼

asked Jan 14 '19 at 07:08 PM in Blueprint Scripting

avatar image

HALCYON Palace
6 1 2 2

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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:

more ▼

answered Jan 14 '19 at 07:26 PM

avatar image

BenVlodgi
2.1k 37 17 52

avatar image the_batch Jan 14 '19 at 07:44 PM

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.

avatar image BenVlodgi Jan 14 '19 at 08:01 PM

well said :)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question