You are on page 1of 6

Audio System with Settings Menu (Including Custom Subtitle

System)
Setup
In the project settings, you will need to change the game instance class to the
AudioSystemGameInstance class.

You can also use your game instance by copy/pasting the Get Audio System function in
the AudioSystemGameInstance to your game instance and create a reference to the
audio system blueprint as pictured below.
To access the functions in the audio system, you will need to access it in the following
manner (If you are using your game instance you will have to change all calls of the Get
Audio System function by replacing the cast to AudioSystemGameInstance with a cast
to your game instance)
Functions

Enable Game Music - Enables and disables the GameMusic audio component in the
AudioSystemBlueprint. By default, the GameMusic audio component is disabled at the
start. An example of use can be found in the ExampleMap level blueprint and the
AudioSettingsUI widget.

Enable UI Music - Enables and disables the UIMusic audio component in the
AudioSystemBlueprint. By default, the UIMusic audio component is disabled at the start.
By default, this audio component can play while the game is paused. An example of use
can be found in the AudioSettingsUI widget.

Load Settings - Used to load the audio settings from the previous session. An example
can be found in the AudioSettingsUI widget.
Save Settings - Used to save the audio settings from the current session. An example
can be found in the AudioSettingsUI widget.

Play Dialogue Cues - Plays a series of DialogueCues (one right after another, or a
single dialogue cue). An example can be found in the ExampleDialogueTrigger
Blueprint.

Play SFX 2D - Plays a sound using the AudioSystem volume settings. Similar in use as
the default Play Sound 2D. An example can be found in the ExampleDialogueTrigger
Blueprint.

Play SFX 3D - Plays a sound using the AudioSystem volume settings at a given
location. Similar in use as the default Play Sound at Location.

Dialogue Cues

Dialogue Cues are used to add subtitles and a priority, to a sound cue. You can create
your DialogueCue by creating a new Blueprint and selecting the Dialogue Cue Base BP
class as the parent class. Once created you will need to populate the default values of
the class. To add subtitles, you will want to populate the subtitles variable by inserting a
new element where the key is the string representing the language and the value is the
string of words you want to be displayed on the screen while the Sound Cue is playing.
(You want to make sure that the language keys match the options in the LanguageBox
in the AudioSettingsUI widget). There are various examples of DialogueCues found in
the Example Sound Files folder.
Audio Settings Widget

By default, this widget only highlights elements based on mouse usage. There is a
premade way to switch the highlighting to work for keyboard and gamepad. You can find
this option in the widget Blueprint.
Additional Info
Additional info can be found in the comments of each Blueprint.

You might also like