VoiceChatVolumeControlBus

VoiceChatVolumeControlBus

#Overview

name: VoiceChatVolumeControlBus

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 VoiceChatVolumeControlBus is to manage the volume control for voice chat audio in the game. It is part of the audio system, specifically designed to handle user-adjustable voice chat volume settings.

This setting variable is primarily used in the Lyra game project, which is likely built on top of Unreal Engine 5. It is utilized by the LyraAudioMixEffectsSubsystem and LyraSettingsLocal classes, indicating that it’s part of the game’s audio management and user settings modules.

The value of this variable is set in the LyraAudioSettings class, which inherits from UDeveloperSettings. It is defined as a configurable property, allowing developers to assign a SoundControlBus asset to it through the Unreal Engine editor.

VoiceChatVolumeControlBus interacts with other audio-related variables and systems:

  1. It’s used alongside other control buses for different audio categories (e.g., music, SFX).
  2. It’s part of a broader user mix settings system, as evidenced by its category in the LyraAudioSettings class.

Developers should be aware of the following when using this variable:

  1. It needs to be properly initialized and loaded before use.
  2. It should be cast to USoundControlBus when accessed, as demonstrated in the code snippets.
  3. Error handling should be implemented in case the asset fails to load or is of the wrong type.

Best practices for using this variable include:

  1. Ensuring that the correct SoundControlBus asset is assigned in the project settings.
  2. Implementing proper error checking and fallback mechanisms when accessing the control bus.
  3. Using it consistently throughout the audio system for voice chat volume control.
  4. Considering its integration with the overall audio mixing and settings system of the game.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:220, section: [/Script/LyraGame.LyraAudioSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Audio/LyraAudioMixEffectsSubsystem.cpp:137

Scope (from outer to inner):

file
function     void ULyraAudioMixEffectsSubsystem::PostInitialize

Source code excerpt:

		}

		if (UObject* ObjPath = LyraAudioSettings->VoiceChatVolumeControlBus.TryLoad())
		{
			if (USoundControlBus* SoundControlBus = Cast<USoundControlBus>(ObjPath))
			{
				VoiceChatControlBus = SoundControlBus;
			}
			else

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Audio/LyraAudioSettings.h:64

Scope (from outer to inner):

file
class        class ULyraAudioSettings : public UDeveloperSettings

Source code excerpt:

	/** 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 */
	UPROPERTY(config, EditAnywhere, Category = EffectSettings)
	TArray<FLyraSubmixEffectChainMap> HDRAudioSubmixEffectChain;
	
	/** Submix Processing Chains to achieve low dynamic range audio output */

#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:1499

Scope (from outer to inner):

file
function     void ULyraSettingsLocal::LoadUserControlBusMix

Source code excerpt:

				}

				if (UObject* ObjPath = LyraAudioSettings->VoiceChatVolumeControlBus.TryLoad())
				{
					if (USoundControlBus* SoundControlBus = Cast<USoundControlBus>(ObjPath))
					{
						VoiceChatControlBus = SoundControlBus;
						ControlBusMap.Add(TEXT("VoiceChat"), VoiceChatControlBus);
					}