au.3dVisualize.Listeners
au.3dVisualize.Listeners
#Overview
name: au.3dVisualize.Listeners
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether or not listeners are visible when 3d visualize is enabled. \n0: Not Enabled, 1: Enabled
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.3dVisualize.Listeners is to control the visibility of audio listeners when 3D visualization is enabled in Unreal Engine’s audio system. This setting variable is part of the audio debugging and visualization features.
This setting variable is primarily used by the Engine’s audio subsystem, specifically within the audio debugging functionality. It’s referenced in the AudioDebug.cpp file, which is part of the Engine’s runtime module.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 and can be changed at runtime using console commands or through engine configuration files.
The associated variable ActiveSoundVisualizeListenersCVar directly interacts with au.3dVisualize.Listeners. They share the same value, and ActiveSoundVisualizeListenersCVar is used in the actual code logic to determine whether to visualize listeners.
Developers must be aware that this variable is a boolean flag (0 or 1) that enables or disables the visualization of audio listeners. When enabled (set to 1), it will cause the engine to render visual representations of audio listeners in the 3D space, which can be useful for debugging but may have performance implications.
Best practices when using this variable include:
- Only enable it when necessary for debugging or development purposes.
- Be mindful of potential performance impact when enabled, especially in production builds.
- Use it in conjunction with other audio visualization tools for a comprehensive understanding of the audio system’s behavior.
- Remember to disable it when not needed to avoid unnecessary rendering overhead.
Regarding the associated variable ActiveSoundVisualizeListenersCVar:
The purpose of ActiveSoundVisualizeListenersCVar is to serve as the actual flag used in the code logic to determine whether to visualize audio listeners. It’s an internal representation of the au.3dVisualize.Listeners console variable.
This variable is used directly in the FAudioDebugger::DrawDebugInfo function within the Audio namespace. It controls whether the function proceeds with drawing debug information for audio listeners.
The value of ActiveSoundVisualizeListenersCVar is set by the console variable system, mirroring the value of au.3dVisualize.Listeners.
Developers should be aware that modifying ActiveSoundVisualizeListenersCVar directly in code is not recommended. Instead, they should use the console variable au.3dVisualize.Listeners to control this functionality.
Best practices for ActiveSoundVisualizeListenersCVar include:
- Treat it as a read-only variable in most scenarios.
- Use the corresponding console variable (au.3dVisualize.Listeners) to modify its value.
- When reading its value in code, be aware that it can change at runtime based on console commands or configuration changes.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:38
Scope: file
Source code excerpt:
static int32 ActiveSoundVisualizeListenersCVar = 0;
FAutoConsoleVariableRef CVarAudioVisualizeListeners(
TEXT("au.3dVisualize.Listeners"),
ActiveSoundVisualizeListenersCVar,
TEXT("Whether or not listeners are visible when 3d visualize is enabled. \n")
TEXT("0: Not Enabled, 1: Enabled"),
ECVF_Default);
static int32 ActiveSoundVisualizeTypeCVar = 0;
#Associated Variable and Callsites
This variable is associated with another variable named ActiveSoundVisualizeListenersCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:36
Scope: file
Source code excerpt:
ECVF_Default);
static int32 ActiveSoundVisualizeListenersCVar = 0;
FAutoConsoleVariableRef CVarAudioVisualizeListeners(
TEXT("au.3dVisualize.Listeners"),
ActiveSoundVisualizeListenersCVar,
TEXT("Whether or not listeners are visible when 3d visualize is enabled. \n")
TEXT("0: Not Enabled, 1: Enabled"),
ECVF_Default);
static int32 ActiveSoundVisualizeTypeCVar = 0;
FAutoConsoleVariableRef CVarAudioVisualizeActiveSounds(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1197
Scope (from outer to inner):
file
namespace Audio
function void FAudioDebugger::DrawDebugInfo
Source code excerpt:
{
#if ENABLE_DRAW_DEBUG
if (!ActiveSoundVisualizeListenersCVar)
{
return;
}
check(IsInAudioThread());