voice.JitterBufferDelay
voice.JitterBufferDelay
#Overview
name: voice.JitterBufferDelay
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The default amount of audio we buffer, in seconds, before we play back audio. Decreasing this value will decrease latency but increase the potential for underruns.\nValue: Number of seconds of audio we buffer.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of voice.JitterBufferDelay is to control the amount of audio buffering in the voice communication system of Unreal Engine. It determines how much audio data is stored before playback begins, which affects the balance between latency and potential audio underruns.
This setting variable is primarily used in the voice communication subsystem of Unreal Engine. Based on the callsites, it appears to be part of the Engine module, specifically in the voice configuration and VOIP (Voice over IP) functionality.
The value of this variable is set using the FAutoConsoleVariableRef mechanism, which allows it to be modified at runtime through console commands. Its default value is 0.3 seconds, as seen in the initialization of JitterBufferDelayCvar.
The associated variable JitterBufferDelayCvar directly interacts with voice.JitterBufferDelay. They share the same value, with JitterBufferDelayCvar being the actual storage for the setting.
Developers must be aware that modifying this variable affects the trade-off between voice communication latency and audio quality. Decreasing the value will reduce latency but increase the risk of audio underruns, which can result in choppy or interrupted audio.
Best practices when using this variable include:
- Carefully consider the balance between latency and audio quality for your specific use case.
- Test thoroughly with different network conditions to ensure a good experience for all users.
- Provide user-facing options to adjust this value if voice chat quality is crucial for your application.
Regarding the associated variable JitterBufferDelayCvar:
The purpose of JitterBufferDelayCvar is to serve as the actual storage for the voice.JitterBufferDelay setting. It’s a static float variable that holds the current value of the jitter buffer delay.
This variable is used within the Engine module, specifically in the VOIP functionality. It’s accessed directly in the UVOIPStatics::GetBufferingDelay() function, which suggests it’s part of the public API for voice settings.
The value of JitterBufferDelayCvar is set initially to 0.3f and can be modified through the console variable system using voice.JitterBufferDelay.
JitterBufferDelayCvar interacts directly with voice.JitterBufferDelay, effectively acting as its backing storage.
Developers should be aware that this variable is the actual value used by the engine, so any changes to voice.JitterBufferDelay will be reflected here.
Best practices for JitterBufferDelayCvar include:
- Avoid modifying this variable directly; instead, use the voice.JitterBufferDelay console variable.
- When retrieving the current jitter buffer delay value, use the UVOIPStatics::GetBufferingDelay() function rather than accessing JitterBufferDelayCvar directly, as this provides a cleaner API and potential for future modifications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VoiceConfig.cpp:42
Scope: file
Source code excerpt:
static float JitterBufferDelayCvar = 0.3f;
FAutoConsoleVariableRef CVarJitterBufferDelay(
TEXT("voice.JitterBufferDelay"),
JitterBufferDelayCvar,
TEXT("The default amount of audio we buffer, in seconds, before we play back audio. Decreasing this value will decrease latency but increase the potential for underruns.\n")
TEXT("Value: Number of seconds of audio we buffer."),
ECVF_Default);
static float MicNoiseGateThresholdCvar = 0.08f;
#Associated Variable and Callsites
This variable is associated with another variable named JitterBufferDelayCvar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VoiceConfig.cpp:40
Scope: file
Source code excerpt:
ECVF_Default);
static float JitterBufferDelayCvar = 0.3f;
FAutoConsoleVariableRef CVarJitterBufferDelay(
TEXT("voice.JitterBufferDelay"),
JitterBufferDelayCvar,
TEXT("The default amount of audio we buffer, in seconds, before we play back audio. Decreasing this value will decrease latency but increase the potential for underruns.\n")
TEXT("Value: Number of seconds of audio we buffer."),
ECVF_Default);
static float MicNoiseGateThresholdCvar = 0.08f;
FAutoConsoleVariableRef CVarMicNoiseGateThreshold(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/VoiceConfig.cpp:193
Scope (from outer to inner):
file
function float UVOIPStatics::GetBufferingDelay
Source code excerpt:
float UVOIPStatics::GetBufferingDelay()
{
return JitterBufferDelayCvar;
}
float UVOIPStatics::GetVoiceNoiseGateLevel()
{
return MicNoiseGateThresholdCvar;
}