au.Debug.ShowSoundClassHierarchy
au.Debug.ShowSoundClassHierarchy
#Overview
name: au.Debug.ShowSoundClassHierarchy
This variable is created as a Console Variable (cvar).
- type:
Exec
- help:
Sorry: Exec commands have no help
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.Debug.ShowSoundClassHierarchy is to provide a debugging tool for displaying the hierarchy of sound classes in the Unreal Engine audio system. This setting variable is primarily used for diagnostic and development purposes within the audio subsystem.
This setting variable is relied upon by the Unreal Engine’s audio subsystem, specifically within the FAudioDevice class. It’s used in conjunction with the HandleShowSoundClassHierarchyCommand function to display the sound class hierarchy when requested.
The value of this variable is not directly set in the provided code snippets. However, it’s likely set through engine configuration files or runtime commands.
The associated variable ShowSoundClassHierarchy interacts with au.Debug.ShowSoundClassHierarchy. They share the same value and are used in the same context within the FAudioDevice class.
Developers should be aware that this variable is primarily for debugging purposes. It’s used to display the sound class hierarchy, which can be helpful for understanding the structure of sound classes in a project, but it’s not meant for runtime gameplay functionality.
Best practices when using this variable include:
- Use it during development and debugging phases, not in production builds.
- Combine it with other audio debugging tools for a comprehensive view of the audio system.
- Be aware that displaying the sound class hierarchy might have a performance impact, so use it judiciously.
Regarding the associated variable ShowSoundClassHierarchy:
- It’s a function within the FAudioDevice class that actually performs the display of the sound class hierarchy.
- It can be called with a specific USoundClass as a parameter to show a subset of the hierarchy, or without parameters to show the entire hierarchy.
- The function uses recursion to display the hierarchy, with each level of the hierarchy indented for clarity.
- It’s typically called in response to console commands or debugging requests, not during normal gameplay.
Developers should use this function when they need to inspect the structure of their project’s sound classes, particularly when troubleshooting audio-related issues or optimizing the audio system structure.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:2262
Scope (from outer to inner):
file
function bool FAudioDevice::Exec
Source code excerpt:
return HandleListSoundClassesCommand(Cmd, Ar);
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ShowSoundClassHierarchy")))
{
return HandleShowSoundClassHierarchyCommand(Cmd, Ar);
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ListSoundClassVolumes")))
{
return HandleListSoundClassVolumesCommand(Cmd, Ar);
#Associated Variable and Callsites
This variable is associated with another variable named ShowSoundClassHierarchy
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:1188
Scope (from outer to inner):
file
function bool FAudioDevice::HandleShowSoundClassHierarchyCommand
Source code excerpt:
bool FAudioDevice::HandleShowSoundClassHierarchyCommand(const TCHAR* Cmd, FOutputDevice& Ar)
{
FAudioThreadSuspendContext AudioThreadSuspend;
ShowSoundClassHierarchy(Ar);
return true;
}
bool FAudioDevice::HandleListWavesCommand(const TCHAR* Cmd, FOutputDevice& Ar)
{
FAudioThreadSuspendContext AudioThreadSuspend;
TArray<FWaveInstance*> WaveInstances;
int32 FirstActiveIndex = GetSortedActiveWaveInstances(WaveInstances, ESortedActiveWaveGetType::QueryOnly);
for (int32 InstanceIndex = FirstActiveIndex; InstanceIndex < WaveInstances.Num(); InstanceIndex++)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:1331
Scope (from outer to inner):
file
function void FAudioDevice::ShowSoundClassHierarchy
Source code excerpt:
Ar.Logf(TEXT("%d total sounds in %d classes"), TotalSounds, AudioClassInfos.Num());
return true;
}
void FAudioDevice::ShowSoundClassHierarchy(FOutputDevice& Ar, USoundClass* InSoundClass, int32 Indent ) const
{
TArray<USoundClass*> SoundClassesToShow;
if (InSoundClass)
{
SoundClassesToShow.Add(InSoundClass);
}
else
{
for (TMap<USoundClass*, FSoundClassProperties>::TConstIterator It(SoundClasses); It; ++It)
{
USoundClass* SoundClass = It.Key();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:1365
Scope (from outer to inner):
file
function void FAudioDevice::ShowSoundClassHierarchy
Source code excerpt:
}
for (int32 i = 0; i < SoundClass->ChildClasses.Num(); ++i)
{
if (SoundClass->ChildClasses[i])
{
ShowSoundClassHierarchy(Ar, SoundClass->ChildClasses[i], Indent+1);
}
}
}
}
bool FAudioDevice::HandleDumpSoundInfoCommand(const TCHAR* Cmd, FOutputDevice& Ar)
{
using namespace AudioDeviceUtils;
FAudioThreadSuspendContext AudioThreadSuspend;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:2259
Scope (from outer to inner):
file
function bool FAudioDevice::Exec
Source code excerpt:
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ListSoundClasses")))
{
return HandleListSoundClassesCommand(Cmd, Ar);
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ShowSoundClassHierarchy")))
{
return HandleShowSoundClassHierarchyCommand(Cmd, Ar);
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ListSoundClassVolumes")))
{
return HandleListSoundClassVolumesCommand(Cmd, Ar);
}
else if (ParseAudioExecCmd(&Cmd, TEXT("ListAudioComponents")))
{
return HandleListAudioComponentsCommand(Cmd, Ar);
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/AudioDevice.h:502
Scope (from outer to inner):
file
class class FAudioDevice : public FExec
Source code excerpt:
void HandleAudioSoloCommon(const TCHAR* Cmd, FOutputDevice& Ar, FToggleSoloPtr Funct);
/**
* Lists a summary of loaded sound collated by class
*/
void ShowSoundClassHierarchy(FOutputDevice& Ar, USoundClass* SoundClass = nullptr, int32 Indent = 0) const;
/**
* Gets a summary of loaded sound collated by class
*/
void GetSoundClassInfo(TMap<FName, FAudioClassInfo>& AudioClassInfos);
#endif
void UpdateAudioPluginSettingsObjectCache();
public: