DialogueVolumeControlBus
DialogueVolumeControlBus
#Overview
name: DialogueVolumeControlBus
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DialogueVolumeControlBus is to control the volume of dialogue audio in the game. It is a part of the audio system in Unreal Engine 5, specifically for managing user-configurable audio settings.
This setting variable is primarily used in the Lyra game project, which is likely a sample or template project for Unreal Engine 5. It is utilized by the following subsystems and modules:
- LyraAudioMixEffectsSubsystem
- LyraAudioSettings
- LyraSettingsLocal
The value of this variable is set in the LyraAudioSettings class, which inherits from UDeveloperSettings. It is defined as a config property, meaning its value can be set in configuration files and edited in the Unreal Engine editor.
DialogueVolumeControlBus interacts with other audio-related variables, such as VoiceChatVolumeControlBus, and is part of a broader audio settings system. It is used to create and manage a USoundControlBus object, which is then used to control the volume of dialogue in the game.
Developers should be aware of the following when using this variable:
- It is loaded asynchronously using TryLoad(), so there should be error handling in place for cases where the load fails.
- The variable is of type FSoftObjectPath, which means it’s a reference to an asset that can be loaded on-demand.
- It is cast to USoundControlBus when used, so the referenced asset must be of this type.
Best practices when using this variable include:
- Ensure the referenced SoundControlBus asset exists and is properly set up in the project.
- Use the LyraAudioSettings class to access and modify this variable, rather than hardcoding values.
- Implement proper error handling when loading and using the control bus.
- Consider the overall audio mix when adjusting dialogue volume, ensuring it balances well with other audio elements.
- Use this in conjunction with other audio settings to provide a comprehensive audio configuration system for users.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:219, section: [/Script/LyraGame.LyraAudioSettings]
- INI Section:
/Script/LyraGame.LyraAudioSettings
- Raw value:
/Game/Audio/Modulation/ControlBuses/CB_Dialogue.CB_Dialogue
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.cpp:125
Scope (from outer to inner):
file
function void ULyraAudioMixEffectsSubsystem::PostInitialize
Source code excerpt:
}
if (UObject* ObjPath = LyraAudioSettings->DialogueVolumeControlBus.TryLoad())
{
if (USoundControlBus* SoundControlBus = Cast<USoundControlBus>(ObjPath))
{
DialogueControlBus = SoundControlBus;
}
else
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Audio/LyraAudioSettings.h:60
Scope (from outer to inner):
file
class class ULyraAudioSettings : public UDeveloperSettings
Source code excerpt:
/** Control Bus assigned to the Dialogue sound volume setting */
UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus"))
FSoftObjectPath DialogueVolumeControlBus;
/** Control Bus assigned to the VoiceChat sound volume setting */
UPROPERTY(config, EditAnywhere, Category = UserMixSettings, meta = (AllowedClasses = "/Script/AudioModulation.SoundControlBus"))
FSoftObjectPath VoiceChatVolumeControlBus;
/** Submix Processing Chains to achieve high dynamic range audio output */
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:1486
Scope (from outer to inner):
file
function void ULyraSettingsLocal::LoadUserControlBusMix
Source code excerpt:
}
if (UObject* ObjPath = LyraAudioSettings->DialogueVolumeControlBus.TryLoad())
{
if (USoundControlBus* SoundControlBus = Cast<USoundControlBus>(ObjPath))
{
DialogueControlBus = SoundControlBus;
ControlBusMap.Add(TEXT("Dialogue"), DialogueControlBus);
}