VoiPSoundClass

VoiPSoundClass

#Overview

name: VoiPSoundClass

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 VoiPSoundClass is to specify the sound class to be used for Voice over IP (VoIP) audio components in Unreal Engine 5. This setting variable is primarily used for managing audio settings related to voice communication in networked games or applications.

The VoiPSoundClass variable is primarily used by the Online Subsystem Utils plugin, which is part of Unreal Engine’s networking and online services infrastructure. Specifically, it is used in the CreateVoiceAudioComponent and CreateVoiceSynthComponent functions within the OnlineSubsystemUtils.cpp file.

The value of this variable is set in the Audio Settings configuration. It is defined as a FSoftObjectPath in the UAudioSettings class, which inherits from UDeveloperSettings. This allows developers to set the VoiP Sound Class through the project settings in the Unreal Engine editor.

The VoiPSoundClass variable interacts with AudioComponent and UVoipListenerSynthComponent objects. When creating these components, the code checks if the VoiPSoundClass path is valid and, if so, loads the corresponding USoundClass object to set the SoundClassOverride or SoundClass property of the respective component.

Developers must be aware that this variable is used to control the audio characteristics of VoIP communication. Proper configuration of the associated sound class can significantly impact the quality and behavior of voice chat in the game or application.

Best practices when using this variable include:

  1. Ensure that a valid sound class is set in the project’s audio settings for VoIP.
  2. Configure the VoIP sound class to have appropriate properties for voice communication, such as compression settings, effects, and volume levels.
  3. Test the VoIP functionality thoroughly with different network conditions to ensure consistent audio quality.
  4. Consider creating a separate sound class specifically for VoIP to have fine-grained control over voice chat audio without affecting other game audio.
  5. Be mindful of performance implications when applying effects or processing to the VoIP sound class, especially on lower-end devices.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:250, section: [/Script/Engine.AudioSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:129

Scope (from outer to inner):

file
function     UAudioComponent* CreateVoiceAudioComponent

Source code excerpt:

				AudioComponent->SetVolumeMultiplier(1.5f);

				const FSoftObjectPath VoiPSoundClassName = GetDefault<UAudioSettings>()->VoiPSoundClass;
				if (VoiPSoundClassName.IsValid())
				{
					AudioComponent->SoundClassOverride = LoadObject<USoundClass>(nullptr, *VoiPSoundClassName.ToString());
				}
			}
			else

#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:156

Scope (from outer to inner):

file
function     UVoipListenerSynthComponent* CreateVoiceSynthComponent

Source code excerpt:

			if (SynthComponentPtr)
			{
				const FSoftObjectPath VoiPSoundClassName = GetDefault<UAudioSettings>()->VoiPSoundClass;
				if (VoiPSoundClassName.IsValid())
				{
					SynthComponentPtr->SoundClass = LoadObject<USoundClass>(nullptr, *VoiPSoundClassName.ToString());
				}

				SynthComponentPtr->bAlwaysPlay = CvarAlwaysPlayVoipComponent;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/AudioSettings.h:150

Scope (from outer to inner):

file
class        class UAudioSettings : public UDeveloperSettings

Source code excerpt:

	/** Sound class to be used for the VOIP audio component */
	UPROPERTY(config, EditAnywhere, Category="Audio", meta=(AllowedClasses="/Script/Engine.SoundClass", DisplayName = "VOIP Sound Class"))
	FSoftObjectPath VoiPSoundClass;

	/** The default submix through which all sounds are routed to. The root submix that outputs to audio hardware. */
	UPROPERTY(config, EditAnywhere, Category="Mix", meta=(AllowedClasses="/Script/Engine.SoundSubmix"))
	FSoftObjectPath MasterSubmix;

	/** The default submix to use for implicit submix sends (i.e. if the base submix send is null or if a submix parent is null) */