au.3dVisualize.ActiveSounds.Type
au.3dVisualize.ActiveSounds.Type
#Overview
name: au.3dVisualize.ActiveSounds.Type
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to show all sounds, on AudioComponents (Components Only), or off of AudioComponents (Non-Component Only). \n0: All, 1: Components Only, 2: Non-Component Only
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.3dVisualize.ActiveSounds.Type is to control the visualization of active sounds in the Unreal Engine’s audio debugging system. It allows developers to filter which types of active sounds are visualized in the 3D viewport.
This setting variable is primarily used by the audio debugging subsystem within Unreal Engine’s core engine module. It’s specifically utilized in the AudioDebug.cpp file, which is part of the engine’s runtime audio debugging functionality.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 by default but can be changed at runtime through console commands or project settings.
The associated variable ActiveSoundVisualizeTypeCVar directly interacts with au.3dVisualize.ActiveSounds.Type. They share the same value, with ActiveSoundVisualizeTypeCVar being the C++ variable that stores the actual integer value.
Developers must be aware that this variable accepts three different values: 0: Visualize all active sounds 1: Visualize only sounds associated with AudioComponents 2: Visualize only sounds not associated with AudioComponents
When using this variable, developers should consider the following best practices:
- Use it primarily for debugging purposes, not in production code.
- Be aware that excessive visualization might impact performance, especially in scenes with many active sounds.
- Combine this setting with other audio debugging tools for a comprehensive understanding of the audio system’s behavior.
- Remember to reset the value to 0 (or turn off visualization entirely) when not actively debugging to avoid unnecessary overhead.
Regarding the associated variable ActiveSoundVisualizeTypeCVar:
The purpose of ActiveSoundVisualizeTypeCVar is to serve as the actual storage for the au.3dVisualize.ActiveSounds.Type setting within the C++ code.
This variable is used directly in the audio debugging system’s code to determine which active sounds should be visualized. It’s checked in the FAudioDebugger::DrawDebugInfo function to filter the sounds that will be drawn in the debug visualization.
The value of ActiveSoundVisualizeTypeCVar is set through the console variable system, mirroring the value of au.3dVisualize.ActiveSounds.Type.
There are no other variables that directly interact with ActiveSoundVisualizeTypeCVar beyond au.3dVisualize.ActiveSounds.Type.
Developers should be aware that modifying ActiveSoundVisualizeTypeCVar directly in C++ code is not recommended. Instead, they should use the console variable au.3dVisualize.ActiveSounds.Type to change its value.
Best practices for using ActiveSoundVisualizeTypeCVar include:
- Treat it as read-only in C++ code.
- Use it for conditional logic in audio debugging visualizations.
- Be aware of its performance impact when used in frequently called functions.
- Consider caching its value if used in performance-critical sections to avoid frequent CVar lookups.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:46
Scope: file
Source code excerpt:
static int32 ActiveSoundVisualizeTypeCVar = 0;
FAutoConsoleVariableRef CVarAudioVisualizeActiveSounds(
TEXT("au.3dVisualize.ActiveSounds.Type"),
ActiveSoundVisualizeTypeCVar,
TEXT("Whether to show all sounds, on AudioComponents (Components Only), or off of AudioComponents (Non-Component Only). \n")
TEXT("0: All, 1: Components Only, 2: Non-Component Only"),
ECVF_Default);
static int32 SpatialSourceVisualizeEnabledCVar = 1;
#Associated Variable and Callsites
This variable is associated with another variable named ActiveSoundVisualizeTypeCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:44
Scope: file
Source code excerpt:
ECVF_Default);
static int32 ActiveSoundVisualizeTypeCVar = 0;
FAutoConsoleVariableRef CVarAudioVisualizeActiveSounds(
TEXT("au.3dVisualize.ActiveSounds.Type"),
ActiveSoundVisualizeTypeCVar,
TEXT("Whether to show all sounds, on AudioComponents (Components Only), or off of AudioComponents (Non-Component Only). \n")
TEXT("0: All, 1: Components Only, 2: Non-Component Only"),
ECVF_Default);
static int32 SpatialSourceVisualizeEnabledCVar = 1;
FAutoConsoleVariableRef CVarAudioVisualizeSpatialSourceEnabled(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1089
Scope (from outer to inner):
file
namespace Audio
function void FAudioDebugger::DrawDebugInfo
Source code excerpt:
}
if (ActiveSoundVisualizeTypeCVar > 0)
{
if (ActiveSoundVisualizeTypeCVar == 1 && ActiveSound.GetAudioComponentID() == 0)
{
return;
}
if (ActiveSoundVisualizeTypeCVar == 2 && ActiveSound.GetAudioComponentID() > 0)
{
return;
}
}
FAudioDeviceManager* DeviceManager = GEngine->GetAudioDeviceManager();