au.voip.AlwaysPlayVoiceComponent
au.voip.AlwaysPlayVoiceComponent
#Overview
name: au.voip.AlwaysPlayVoiceComponent
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When set to 1, guarantees that voip components won\'t get deprioritized. \n0: Let voip components get killed, 1: force VOIP components to be higher priority than all other audio sources.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.voip.AlwaysPlayVoiceComponent is to control the prioritization of voice over IP (VoIP) audio components in the Unreal Engine.
This setting variable is primarily used in the Online Subsystem Utils module, specifically within the VoIP system. It affects how the engine handles the prioritization of VoIP audio components relative to other audio sources.
The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. By default, it is set to 1.
The associated variable CvarAlwaysPlayVoipComponent directly interacts with au.voip.AlwaysPlayVoiceComponent. They share the same value, and CvarAlwaysPlayVoipComponent is used in the actual code implementation to control the behavior of VoIP components.
Developers must be aware that this variable has a significant impact on audio prioritization. When set to 1, it forces VoIP components to have higher priority than all other audio sources, which may affect the overall audio mix of the game.
Best practices when using this variable include:
- Carefully consider the impact on other audio sources before enabling it.
- Test thoroughly with different audio scenarios to ensure it doesn’t negatively affect the game’s audio experience.
- Provide a way for users to adjust this setting if voice chat prioritization is important for your game’s multiplayer experience.
Regarding the associated variable CvarAlwaysPlayVoipComponent:
- Its purpose is to serve as the actual int32 variable that stores the value of au.voip.AlwaysPlayVoiceComponent.
- It is used directly in the code to set the bAlwaysPlay property of VoIP synth components.
- The value is set through the console variable system and can be changed at runtime.
- Developers should be aware that modifying CvarAlwaysPlayVoipComponent will directly affect the behavior of VoIP audio components.
- Best practices include using this variable consistently throughout the VoIP-related code and considering its value when debugging audio prioritization issues.
#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:100
Scope: file
Source code excerpt:
static int32 CvarAlwaysPlayVoipComponent = 1;
FAutoConsoleVariableRef CVarAlwaysPlayVoipComponent(
TEXT("au.voip.AlwaysPlayVoiceComponent"),
CvarAlwaysPlayVoipComponent,
TEXT("When set to 1, guarantees that voip components won't get deprioritized. \n")
TEXT("0: Let voip components get killed, 1: force VOIP components to be higher priority than all other audio sources."),
ECVF_Default);
UAudioComponent* CreateVoiceAudioComponent(uint32 SampleRate, int32 NumChannels)
#Associated Variable and Callsites
This variable is associated with another variable named CvarAlwaysPlayVoipComponent
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:98
Scope: file
Source code excerpt:
);
static int32 CvarAlwaysPlayVoipComponent = 1;
FAutoConsoleVariableRef CVarAlwaysPlayVoipComponent(
TEXT("au.voip.AlwaysPlayVoiceComponent"),
CvarAlwaysPlayVoipComponent,
TEXT("When set to 1, guarantees that voip components won't get deprioritized. \n")
TEXT("0: Let voip components get killed, 1: force VOIP components to be higher priority than all other audio sources."),
ECVF_Default);
UAudioComponent* CreateVoiceAudioComponent(uint32 SampleRate, int32 NumChannels)
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:162
Scope (from outer to inner):
file
function UVoipListenerSynthComponent* CreateVoiceSynthComponent
Source code excerpt:
}
SynthComponentPtr->bAlwaysPlay = CvarAlwaysPlayVoipComponent;
SynthComponentPtr->RegisterComponentWithWorld(World);
SynthComponentPtr->Initialize(SampleRate);
}
else
{
UE_LOG(LogVoiceDecode, Warning, TEXT("Unable to create voice synth component!"));