au.Debug.Sounds.Sort

au.Debug.Sounds.Sort

#Overview

name: au.Debug.Sounds.Sort

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.Debug.Sounds.Sort is to control the sorting and display of sound statistics when audio debugging is active in Unreal Engine 5. This setting variable is primarily used for the audio debugging system.

The Unreal Engine subsystem that relies on this setting variable is the audio debugging module, which is part of the Engine’s runtime. Specifically, it’s used in the AudioDebug.cpp file, which handles various audio debugging functionalities.

The value of this variable is set through the console variable system (CVar) in Unreal Engine. It’s initialized with a default value of “Name” and can be changed at runtime through console commands.

The associated variable AudioDebugSoundSortCVarCVar directly interacts with au.Debug.Sounds.Sort. They share the same value, with AudioDebugSoundSortCVarCVar acting as the actual storage for the setting.

Developers must be aware that this variable affects how sound statistics are sorted and displayed during debugging. The available sorting options are:

When using this variable, best practices include:

  1. Use it primarily for debugging purposes, not for gameplay or production code.
  2. Be consistent in how you set and use the sorting option across your development team to ensure everyone is looking at the same data when debugging.
  3. Consider the most relevant sorting option for the specific audio issue you’re debugging.

Regarding the associated variable AudioDebugSoundSortCVarCVar:

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static FString AudioDebugSoundSortCVarCVar = TEXT("Name");
FAutoConsoleVariableRef CVarAudioDebugSoundSortCVar(
	TEXT("au.Debug.Sounds.Sort"),
	AudioDebugSoundSortCVarCVar,
	TEXT("Value to sort by and display when sound stats are active. \n")
	TEXT("Class, Distance, Name (Default), Priority (Highest of wave instances per sound), Time, Waves, Volume"),
	ECVF_Default);

static FString AudioDebugStatSoundTextColorCVar = TEXT("White");

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

static FString AudioDebugSoundSortCVarCVar = TEXT("Name");
FAutoConsoleVariableRef CVarAudioDebugSoundSortCVar(
	TEXT("au.Debug.Sounds.Sort"),
	AudioDebugSoundSortCVarCVar,
	TEXT("Value to sort by and display when sound stats are active. \n")
	TEXT("Class, Distance, Name (Default), Priority (Highest of wave instances per sound), Time, Waves, Volume"),
	ECVF_Default);

static FString AudioDebugStatSoundTextColorCVar = TEXT("White");
FAutoConsoleVariableRef CVarAudioDebugStatSoundColor(

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

Scope (from outer to inner):

file
namespace    Audio
function     void UpdateDisplaySort

Source code excerpt:

	void UpdateDisplaySort(FAudioStats& InAudioStats)
	{
		if (AudioDebugSoundSortCVarCVar == TEXT("distance"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Distance;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("class"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Class;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("name"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Name;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("time"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::PlaybackTime;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("priority"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Priority;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("volume"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Volume;
		}
		else if (AudioDebugSoundSortCVarCVar == TEXT("waves"))
		{
			InAudioStats.DisplaySort = FAudioStats::EDisplaySort::Waves;
		}
	}

	struct FAudioStats_AudioThread