au.Debug.Modulation.UpdateRate
au.Debug.Modulation.UpdateRate
#Overview
name: au.Debug.Modulation.UpdateRate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sets update rate for modulation debug statistics (in seconds).\nDefault: 0.1f
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.Debug.Modulation.UpdateRate is to control the update rate for modulation debug statistics in the Audio Modulation system of Unreal Engine 5. This setting variable is specifically designed for debugging purposes within the audio modulation subsystem.
This setting variable is primarily used in the Audio Modulation plugin, which is part of Unreal Engine’s audio system. Based on the callsites, it’s clear that this variable is utilized in the AudioModulationDebugger.cpp file, which is responsible for debugging audio modulation features.
The value of this variable is set using a console variable (CVar) system. It’s initialized with a default value of 0.1 seconds and can be modified at runtime through the console or configuration files.
The au.Debug.Modulation.UpdateRate variable interacts directly with AudioModulationDebugUpdateRateCVar. They share the same value, with AudioModulationDebugUpdateRateCVar being the actual float variable used in the code, while au.Debug.Modulation.UpdateRate is the console variable name used to access and modify this value.
Developers must be aware that this variable affects the frequency at which debug statistics for audio modulation are updated. A lower value will result in more frequent updates but may impact performance, while a higher value will reduce the update frequency but may make real-time debugging less responsive.
Best practices when using this variable include:
- Keep the default value (0.1 seconds) for most debugging scenarios.
- Increase the value if debugging is causing performance issues.
- Decrease the value if more frequent updates are needed for precise debugging.
- Remember to reset it to the default value after debugging to avoid unintended performance impacts in production.
Regarding the associated variable AudioModulationDebugUpdateRateCVar:
The purpose of AudioModulationDebugUpdateRateCVar is to store the actual float value used in the code for controlling the update rate of modulation debug statistics.
This variable is used directly in the Audio Modulation plugin’s debugger system. It’s accessed in the UpdateDebugData function of the FAudioModulationDebugger class to determine whether enough time has elapsed to perform another update of the debug data.
The value of AudioModulationDebugUpdateRateCVar is set through the au.Debug.Modulation.UpdateRate console variable. It’s initialized with a default value of 0.1f.
AudioModulationDebugUpdateRateCVar interacts closely with the ElapsedSinceLastUpdate variable in the UpdateDebugData function. It’s used as a threshold to determine when to update the debug data.
Developers should be aware that modifying AudioModulationDebugUpdateRateCVar directly in the code is not recommended. Instead, they should use the au.Debug.Modulation.UpdateRate console variable to change its value.
Best practices for AudioModulationDebugUpdateRateCVar include:
- Avoid modifying it directly in the code.
- Use it as a read-only variable in custom debug code if needed.
- Remember that its value affects the frequency of debug updates, which can impact performance if set too low.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioModulation/Source/AudioModulation/Private/AudioModulationDebugger.cpp:59
Scope: file
Source code excerpt:
static float AudioModulationDebugUpdateRateCVar = 0.1f;
FAutoConsoleVariableRef CVarAudioModulationDebugUpdateRate(
TEXT("au.Debug.Modulation.UpdateRate"),
AudioModulationDebugUpdateRateCVar,
TEXT("Sets update rate for modulation debug statistics (in seconds).\n")
TEXT("Default: 0.1f"),
ECVF_Default);
static FAutoConsoleCommandWithWorldAndArgs CVarAudioModulationDebugBuses(
#Associated Variable and Callsites
This variable is associated with another variable named AudioModulationDebugUpdateRateCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioModulation/Source/AudioModulation/Private/AudioModulationDebugger.cpp:57
Scope: file
Source code excerpt:
}
static float AudioModulationDebugUpdateRateCVar = 0.1f;
FAutoConsoleVariableRef CVarAudioModulationDebugUpdateRate(
TEXT("au.Debug.Modulation.UpdateRate"),
AudioModulationDebugUpdateRateCVar,
TEXT("Sets update rate for modulation debug statistics (in seconds).\n")
TEXT("Default: 0.1f"),
ECVF_Default);
static FAutoConsoleCommandWithWorldAndArgs CVarAudioModulationDebugBuses(
TEXT("au.Debug.Modulation.Filter.Buses"),
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioModulation/Source/AudioModulation/Private/AudioModulationDebugger.cpp:410
Scope (from outer to inner):
file
namespace AudioModulation
function void FAudioModulationDebugger::UpdateDebugData
Source code excerpt:
ElapsedSinceLastUpdate += InElapsed;
if (AudioModulationDebugUpdateRateCVar > ElapsedSinceLastUpdate)
{
return;
}
ElapsedSinceLastUpdate = 0.0f;
static const int32 MaxFilteredBuses = 8;