au.Debug.Sounds.ShowPath

au.Debug.Sounds.ShowPath

#Overview

name: au.Debug.Sounds.ShowPath

This variable is created as a Console Variable (cvar).

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.Debug.Sounds.ShowPath is to control the display of the full path of sounds in the audio debugging system of Unreal Engine 5. This setting variable is primarily used for audio debugging and visualization purposes.

This setting variable is mainly utilized by the audio debugging subsystem within the Engine module of Unreal Engine 5. It’s specifically referenced in the AudioDebug.cpp file, which suggests its primary use is in audio debugging functionality.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime through the console or configuration files.

The au.Debug.Sounds.ShowPath variable interacts directly with its associated variable AudioDebugSoundShowPathCVar. They share the same value, with AudioDebugSoundShowPathCVar being the actual integer variable used in the C++ code, while au.Debug.Sounds.ShowPath is the console-accessible name.

Developers should be aware that this variable affects how sound information is displayed in debug output. When enabled (set to 1), it shows the full path of the sound asset; when disabled (set to 0), it shows only the sound name.

Best practices for using this variable include:

  1. Enable it (set to 1) when you need to identify the exact location of sound assets in your project structure.
  2. Disable it (set to 0) for a cleaner, more concise debug output when you’re only interested in the sound names.
  3. Use it in conjunction with other audio debugging tools for a comprehensive understanding of your game’s audio system.

Regarding the associated variable AudioDebugSoundShowPathCVar:

The purpose of AudioDebugSoundShowPathCVar is to serve as the actual integer storage for the au.Debug.Sounds.ShowPath setting within the C++ code.

This variable is used directly in the Engine module, specifically in the audio debugging system. It’s referenced in several places within the AudioDebug.cpp file to control the display of sound asset information.

The value of AudioDebugSoundShowPathCVar is set through the FAutoConsoleVariableRef system, which links it to the au.Debug.Sounds.ShowPath console variable.

AudioDebugSoundShowPathCVar interacts primarily with au.Debug.Sounds.ShowPath, serving as its in-code representation. It’s used in conditional statements to determine how to display sound information in debug output.

Developers should be aware that modifying AudioDebugSoundShowPathCVar directly in code will affect the behavior of the audio debugging system. However, it’s generally better to modify this setting through the console variable system for consistency and ease of use.

Best practices for AudioDebugSoundShowPathCVar include:

  1. Avoid modifying it directly in code; instead, use the console variable system.
  2. When reading its value in code, be aware that it can be changed at runtime, so always use the current value rather than assuming a fixed state.
  3. Consider the performance implications of frequently checking this variable in performance-critical code paths.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:78

Scope: file

Source code excerpt:

static int32 AudioDebugSoundShowPathCVar = 1;
FAutoConsoleVariableRef CVarAudioDebugSoundShowPath(
	TEXT("au.Debug.Sounds.ShowPath"),
	AudioDebugSoundShowPathCVar,
	TEXT("Display full path of sound when enabled.\n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static FString AudioDebugSoundSortCVarCVar = TEXT("Name");

#Associated Variable and Callsites

This variable is associated with another variable named AudioDebugSoundShowPathCVar. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:76

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 AudioDebugSoundShowPathCVar = 1;
FAutoConsoleVariableRef CVarAudioDebugSoundShowPath(
	TEXT("au.Debug.Sounds.ShowPath"),
	AudioDebugSoundShowPathCVar,
	TEXT("Display full path of sound when enabled.\n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static FString AudioDebugSoundSortCVarCVar = TEXT("Name");
FAutoConsoleVariableRef CVarAudioDebugSoundSortCVar(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1834

Scope (from outer to inner):

file
namespace    Audio
function     int32 FAudioDebugger::RenderStatSounds
lambda-function

Source code excerpt:

				AudioStats.StatSoundInfos.Sort([](const FAudioStats::FStatSoundInfo& A, const FAudioStats::FStatSoundInfo& B)
				{
					if (AudioDebugSoundShowPathCVar)
					{
						return A.SoundPath < B.SoundPath;
					}
					return A.SoundName < B.SoundName;
				});
				SortingName = TEXT("Name");

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1886

Scope (from outer to inner):

file
namespace    Audio
function     int32 FAudioDebugger::RenderStatSounds

Source code excerpt:


			bool bDisplayWaves = false;
			const FString DisplayName = AudioDebugSoundShowPathCVar ? StatSoundInfo.SoundPath : StatSoundInfo.SoundName;
			FString DebugValue;
			switch (AudioStats.DisplaySort)
			{
				case FAudioStats::EDisplaySort::Class:
				{
					DebugValue = *StatSoundInfo.SoundClassName.ToString();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1982

Scope (from outer to inner):

file
namespace    Audio
function     int32 FAudioDebugger::RenderStatSounds

Source code excerpt:

				if (StatSoundInfo.ShapeDetailsMap.Num() > 0)
				{
					const FString DebugName = AudioDebugSoundShowPathCVar ? StatSoundInfo.SoundPath : StatSoundInfo.SoundName;
					DrawDebugString(World, SoundTransform.GetTranslation(), *DebugName, nullptr, BodyColor, 0.01f);

					for (auto ShapeDetailsIt = StatSoundInfo.ShapeDetailsMap.CreateConstIterator(); ShapeDetailsIt; ++ShapeDetailsIt)
					{
						const FBaseAttenuationSettings::AttenuationShapeDetails& ShapeDetails = ShapeDetailsIt.Value();
						switch (ShapeDetailsIt.Key())