Activating a Sound Mix
For a case like this (volume control using the UI), it’s best to activate the Sound Mix when the game starts. This is so the Sound Class will automatically use the volume adjustments from the Sound Mix. However, for the sake of simplicity, you will activate the Sound Mix within the widget.
Create an Event Pre Construct node. This is similar to the Event BeginPlay node found in Blueprints.
To activate a Sound Mix, you need to use the Push Sound Mix Modifier node. Create one and connect it to Event Pre Construct. Afterwards, set In Sound Mix Modifier to S_Volume_Mix.
This will activate S_Volume_Mix when WBP_Options spawns.
Click Compile and then close WBP_Options. Press Play and then press the M key to bring up the sliders. Adjust the sliders to affect the volume of each Sound Class.
Where to Go From Here?
You can download the completed project here.
As you can see, it’s pretty easy to get your audio running in Unreal Engine 4. If you’d like to learn more about the audio system, check out the official documentation. You can do other cool things like adding reverb and EQ. Also, be sure to check out the features of the new audio engine when it arrives!
If you want to keep learning, check out the next post in the series, where I’ll show you how to create particle effects.