au.3dVisualize.Enabled
au.3dVisualize.Enabled
#Overview
name: au.3dVisualize.Enabled
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether or not audio visualization 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.Enabled is to control whether audio visualization is enabled in the Unreal Engine’s audio system. This setting variable is part of the audio debugging and visualization features.
This setting variable is primarily used in the Engine module, specifically in the audio device management system. Based on the callsites, it’s referenced in the AudioDeviceManager.cpp file, which is part of the Engine’s runtime.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 (disabled) by default, but can be changed at runtime using console commands or through code.
The au.3dVisualize.Enabled variable interacts directly with the CVarIsVisualizeEnabled variable. They share the same value, with CVarIsVisualizeEnabled being the actual integer storage for the setting.
Developers should be aware that this variable is primarily used for debugging and visualization purposes. It’s not intended for use in production builds or gameplay logic. The variable is only effective when ENABLE_AUDIO_DEBUG is defined, which is typically only in development or debug builds.
Best practices for using this variable include:
- Only enable it when actively debugging audio issues or working on audio visualization features.
- Remember to disable it when not needed to avoid any potential performance impact.
- Use it in conjunction with other audio debugging tools and features for comprehensive audio system analysis.
Regarding the associated variable CVarIsVisualizeEnabled:
The purpose of CVarIsVisualizeEnabled is to store the actual integer value that represents whether audio visualization is enabled or not. It’s the backing variable for the au.3dVisualize.Enabled console variable.
This variable is used directly in the IsVisualizeDebug3dEnabled() function of the FAudioDeviceManager class. It’s checked alongside the audio debugger’s own visualization setting to determine if 3D audio visualization should be enabled.
The value of CVarIsVisualizeEnabled is set through the console variable system when au.3dVisualize.Enabled is modified.
Developers should be aware that modifying CVarIsVisualizeEnabled directly is not the intended way to control this setting. Instead, they should use the au.3dVisualize.Enabled console variable or appropriate engine API calls if available.
Best practices for CVarIsVisualizeEnabled include:
- Treat it as read-only in most scenarios, using it only to check the current state of audio visualization.
- If needing to modify the audio visualization state, use the appropriate console commands or engine APIs rather than modifying this variable directly.
- Be aware of its usage in conditional compilation blocks (ENABLE_AUDIO_DEBUG) when working with or debugging audio visualization features.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:39
Scope: file
Source code excerpt:
static int32 CVarIsVisualizeEnabled = 0;
FAutoConsoleVariableRef CVarAudioVisualizeEnabled(
TEXT("au.3dVisualize.Enabled"),
CVarIsVisualizeEnabled,
TEXT("Whether or not audio visualization is enabled. \n")
TEXT("0: Not Enabled, 1: Enabled"),
ECVF_Default);
static int32 GCVarFlushAudioRenderCommandsOnSuspend = 0;
#Associated Variable and Callsites
This variable is associated with another variable named CVarIsVisualizeEnabled
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:37
Scope: file
Source code excerpt:
ECVF_Default);
static int32 CVarIsVisualizeEnabled = 0;
FAutoConsoleVariableRef CVarAudioVisualizeEnabled(
TEXT("au.3dVisualize.Enabled"),
CVarIsVisualizeEnabled,
TEXT("Whether or not audio visualization is enabled. \n")
TEXT("0: Not Enabled, 1: Enabled"),
ECVF_Default);
static int32 GCVarFlushAudioRenderCommandsOnSuspend = 0;
FAutoConsoleVariableRef CVarFlushAudioRenderCommandsOnSuspend(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDeviceManager.cpp:1135
Scope (from outer to inner):
file
function bool FAudioDeviceManager::IsVisualizeDebug3dEnabled
Source code excerpt:
{
#if ENABLE_AUDIO_DEBUG
return GetDebugger().IsVisualizeDebug3dEnabled() || CVarIsVisualizeEnabled;
#else // ENABLE_AUDIO_DEBUG
return false;
#endif // !ENABLE_AUDIO_DEBUG
}
void FAudioDeviceManager::ToggleVisualize3dDebug()