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"

[TUTORIAL] Simple way to change Global Audio Volume

This post is not a question, but rather a mini tutorial on how to change the game audio volume. Thought it was worth sharing it for anyone struggling with it (like myself) since there doesn't seem to be a solution posted on answerhub or the forum, aside doing it in C++ or using Rama's plugin.

It's actually rather simple

  1. Create a new Sound Mix asset (leave the default settings)

  2. In your Game Instance Blueprint (should work in any BP, but since the GameInstance is persistent, it's the best candidate for the job), do the following script :

alt text

  • Set base sound mix : select the newly create Sound Mix Asset to activate it for the entire session.

  • Set Sound Mix Class Override : Set the Sound Mix and the Sound Class (there are multiple ones, Master is the parent of the other classes). Set the Fade in Time to 0 if you want the change to be immediate.


Some notes :

  • The delay after the Event Init is a bit dirty but mandatory as it won't work otherwise. I suspect it happens too quickly and some audio components have yet to be fully loaded.

  • In the Set Sound Mix Class Override, if the volume is set to zero, any active sounds will be stopped, hence the clamp min 0.01 (there might be a way to prevent this behavior, but I haven't thoroughly looked at it yet)

  • Now, every time you want to change the volume, just execute the event Change Volume with the new value.

Product Version: UE 4.15
Tags:
more ▼

asked May 04 '17 at 06:22 AM in Blueprint Scripting

avatar image

Genova
283 21 25 35

avatar image SyedAman May 14 '17 at 02:19 PM

Anybody know of a way to mute the volume without killing the sound instance so you can resume volume after muting it?

Atm, we need to clamp the volumes to .01 because 0 calls the Audio Component to be destroyed.

avatar image G4m4 May 14 '17 at 04:41 PM

At the moment there is no virtualisation, so any sound that is not played is ignored. You can work around that limitation by keeping track of the elapsed time, and when unmuting the sound you actually start it again and seek to this time point (using the "StartTime" parameter of the Play() method).

avatar image CosmoGorynych Jul 04 '17 at 05:50 AM

Virtualisation is now supported, it can be set in audio wave settings. alt text

avatar image jjwisniewka Jun 02 '17 at 07:24 PM

I wanted to do sliders witth setting sound for sound classes using sound mixer - the problem is later how I can read current sound classes values (sound classes has default values after level load and I can find a way to read value out of sound mix)?

avatar image Genova Jun 04 '17 at 12:08 AM

I don't think you can at the moment. But what I do for my own project is to set a float variable that I use in my menu.

avatar image jjwisniewka Jun 04 '17 at 09:47 AM

And do you know how to store custom data in GameUserSettings?

avatar image Genova Jun 05 '17 at 03:06 AM

In BP I believe you can only store graphic settings. Hence this little tut for audio. https://wiki.unrealengine.com/Save_Graphics_Settings_with_Blueprints

avatar image tomofnz Jun 05 '19 at 12:37 PM

The setting of the volume only worked for me if I went to ProjectSettings:Engine:Audio and set Default Base Sound Mix to my SoundMix asset directly there. But then everything is sweet.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Doesn't seem to work on editor window, but works fine in standalone

more ▼

answered Jul 24 '19 at 08:58 PM

avatar image

Tryedz
64 11 12 16

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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