VoiceNotificationDelta
VoiceNotificationDelta
#Overview
name: VoiceNotificationDelta
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 9
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of VoiceNotificationDelta is to control the timing of voice notifications in the online voice subsystem of Unreal Engine 5. It represents the time interval used to determine when to trigger “not talking” notifications for voice communication.
This setting variable is primarily used by the Online Subsystem Utils plugin, specifically within the voice communication module. The main components that rely on this variable are:
- The OnlineSubsystemUtils module
- The VoiceInterfaceImpl class, which implements the IOnlineVoice interface
The value of this variable is typically set in the DefaultEngine.ini configuration file under the [OnlineSubsystem] section. If not specified in the config file, it defaults to 0.2 seconds.
VoiceNotificationDelta interacts with other voice-related variables such as MaxLocalTalkers, MaxRemoteTalkers, and bHasVoiceEnabled. It is used in conjunction with the LastNotificationTime property of talker objects to manage the talking state of users.
Developers should be aware that:
- This variable affects the responsiveness of the voice system in detecting when a user stops talking.
- A lower value will make the system more responsive but may lead to more frequent state changes.
- A higher value will make the system less responsive but may reduce unnecessary state changes.
Best practices when using this variable include:
- Adjust the value based on the specific needs of your game’s voice communication system.
- Test different values to find the right balance between responsiveness and stability.
- Consider the network conditions and potential latency when setting this value.
- Ensure that the value is properly set in the configuration file to avoid using the default value unintentionally.
- Monitor voice communication performance and user feedback to fine-tune this setting for optimal user experience.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2229, section: [OnlineSubsystem]
- INI Section:
OnlineSubsystem
- Raw value:
0.33
- Is Array:
False
#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:369
Scope (from outer to inner):
file
function bool HandleVoiceCommands
Source code excerpt:
}
float VoiceNotificationDelta = 0.0f;
if (!GConfig->GetFloat(TEXT("OnlineSubsystem"), TEXT("VoiceNotificationDelta"), VoiceNotificationDelta, GEngineIni))
{
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing VoiceNotificationDelta key in OnlineSubsystem of DefaultEngine.ini"));
}
bool bHasVoiceInterfaceEnabled = false;
if (!GConfig->GetBool(TEXT("OnlineSubsystem"), TEXT("bHasVoiceEnabled"), bHasVoiceInterfaceEnabled, GEngineIni))
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/OnlineSubsystemUtils.cpp:404
Scope (from outer to inner):
file
function bool HandleVoiceCommands
Source code excerpt:
UE_LOG_ONLINE_VOICE(Display, TEXT("Max Local Talkers: %d"), MaxLocalTalkers);
UE_LOG_ONLINE_VOICE(Display, TEXT("Max Remote Talkers: %d"), MaxRemoteTalkers);
UE_LOG_ONLINE_VOICE(Display, TEXT("Notification Delta: %0.2f"), VoiceNotificationDelta);
UE_LOG_ONLINE_VOICE(Display, TEXT("Voice Requires Push To Talk: %s"), bRequiresPushToTalk ? TEXT("true") : TEXT("false"));
TArray<FString> OutArray;
VoiceDump.ParseIntoArray(OutArray, TEXT("\n"), false);
for (const FString& Str : OutArray)
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:36
Scope (from outer to inner):
file
function bool FOnlineVoiceImpl::Init
Source code excerpt:
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing MaxRemoteTalkers key in OnlineSubsystem of DefaultEngine.ini"));
}
if (!GConfig->GetFloat(TEXT("OnlineSubsystem"),TEXT("VoiceNotificationDelta"), VoiceNotificationDelta, GEngineIni))
{
VoiceNotificationDelta = 0.2;
UE_LOG_ONLINE_VOICE(Warning, TEXT("Missing VoiceNotificationDelta key in OnlineSubsystem of DefaultEngine.ini"));
}
bool bHasVoiceEnabled = false;
if (GConfig->GetBool(TEXT("OnlineSubsystem"), TEXT("bHasVoiceEnabled"), bHasVoiceEnabled, GEngineIni) && bHasVoiceEnabled)
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:646
Scope (from outer to inner):
file
function void FOnlineVoiceImpl::ProcessTalkingDelegates
Source code excerpt:
// Clear the flag so it only activates when needed
Talker.bIsTalking = false;
Talker.LastNotificationTime = VoiceNotificationDelta;
bShouldNotify = true;
}
}
if (bShouldNotify)
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:694
Scope (from outer to inner):
file
function void FOnlineVoiceImpl::ProcessTalkingDelegates
Source code excerpt:
// Clear the flag so it only activates when needed
Talker.bWasTalking = Talker.bIsTalking;
Talker.LastNotificationTime = VoiceNotificationDelta;
}
}
}
void FOnlineVoiceImpl::ProcessLocalVoicePackets()
{
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:744
Scope (from outer to inner):
file
function void FOnlineVoiceImpl::ProcessLocalVoicePackets
Source code excerpt:
// Mark the person as talking
LocalTalkers[Index].bIsTalking = true;
LocalTalkers[Index].LastNotificationTime = VoiceNotificationDelta;
// Update the length based on what it copied
VoiceData.LocalPackets[Index].Length += uint16(SpaceAvail);
VoiceData.LocalPackets[Index].SampleCount = SampleCount;
#if VOICE_LOOPBACK
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Private/VoiceInterfaceImpl.cpp:833
Scope (from outer to inner):
file
function void FOnlineVoiceImpl::ProcessRemoteVoicePackets
Source code excerpt:
// If the player is marked as muted, they can't be talking
Talker.bIsTalking = !IsLocallyMuted(*Talker.TalkerId);
Talker.LastNotificationTime = VoiceNotificationDelta;
}
}
}
}
// Zero the list without causing a free/realloc
VoiceData.RemotePackets.Reset();
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceInterfaceImpl.h:36
Scope (from outer to inner):
file
class class FOnlineVoiceImpl : public IOnlineVoice
Source code excerpt:
/** Time to wait for new data before triggering "not talking" */
float VoiceNotificationDelta;
/** Buffered voice data I/O */
FVoiceDataImpl VoiceData;
/**
* Finds a remote talker in the cached list
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystemUtils/Source/OnlineSubsystemUtils/Public/VoiceInterfaceImpl.h:77
Scope (from outer to inner):
file
class class FOnlineVoiceImpl : public IOnlineVoice
Source code excerpt:
MaxLocalTalkers(MAX_SPLITSCREEN_TALKERS),
MaxRemoteTalkers(MAX_REMOTE_TALKERS),
VoiceNotificationDelta(0.0f)
{};
// IOnlineVoice
virtual bool Init() override;
virtual void ProcessMuteChangeNotification() override;