au.InteriorData.UseAudioVolumes

au.InteriorData.UseAudioVolumes

#Overview

name: au.InteriorData.UseAudioVolumes

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.InteriorData.UseAudioVolumes is to control whether the game engine gathers interior data from audio volumes. This setting variable is part of the audio system in Unreal Engine 5, specifically related to how sound behaves in different interior spaces.

This setting variable is primarily used in the Engine module, specifically within the ActiveSound system. It’s referenced in the ActiveSound.cpp file, which is responsible for managing active sounds in the game world.

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

The associated variable GatherInteriorDataFromAudioVolumesCVar directly interacts with au.InteriorData.UseAudioVolumes. They share the same value, with GatherInteriorDataFromAudioVolumesCVar being the actual integer variable used in the code logic.

Developers should be aware that this variable affects how the engine handles sound in interior spaces. When enabled (set to 1), the engine will use audio volumes to gather interior data, which can affect sound propagation and reverberation in enclosed spaces. When disabled (set to 0), this feature is turned off, potentially changing how sound behaves in the game world.

Best practices for using this variable include:

  1. Consider performance implications when enabling this feature, as it may require additional processing.
  2. Test thoroughly with both enabled and disabled states to ensure desired audio behavior in different scenarios.
  3. Use in conjunction with other audio settings for a comprehensive sound design approach.

Regarding the associated variable GatherInteriorDataFromAudioVolumesCVar:

The purpose of GatherInteriorDataFromAudioVolumesCVar is to serve as the actual integer variable that the engine code checks to determine whether to gather interior data from audio volumes.

This variable is used within the Engine module, specifically in the ActiveSound system. It’s directly checked in the UpdateWaveInstances function of the FActiveSound class to determine if audio volume data should be considered for interior sound calculations.

The value of GatherInteriorDataFromAudioVolumesCVar is set through the au.InteriorData.UseAudioVolumes console variable. They are linked through the FAutoConsoleVariableRef system, ensuring they always have the same value.

No other variables directly interact with GatherInteriorDataFromAudioVolumesCVar, but it’s used in conjunction with GatherInteriorDataFromIActiveSoundUpdateCVar to determine the overall approach to gathering interior data for sound processing.

Developers should be aware that this variable directly affects the behavior of the UpdateWaveInstances function, which is crucial for sound processing in the engine. Changes to this variable will immediately impact how the engine handles interior sound calculations.

Best practices for using this variable include:

  1. Avoid directly modifying GatherInteriorDataFromAudioVolumesCVar; instead, use the au.InteriorData.UseAudioVolumes console variable to ensure consistency.
  2. Consider the performance impact of enabling this feature, especially in scenes with many audio volumes.
  3. Use in combination with other audio settings and variables for a comprehensive audio solution.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ActiveSound.cpp:23

Scope: file

Source code excerpt:

static int32 GatherInteriorDataFromAudioVolumesCVar = 1;
FAutoConsoleVariableRef CVarGatherInteriorDataFromAudioVolumes(
	TEXT("au.InteriorData.UseAudioVolumes"),
	GatherInteriorDataFromAudioVolumesCVar,
	TEXT("When set to 1, allows gathering of interior data from audio volumes (Legacy).\n")
	TEXT("0: Disabled, 1: Enabled (default)"),
	ECVF_Default);

static int32 GatherInteriorDataFromIActiveSoundUpdateCVar = 1;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ActiveSound.cpp:21

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 GatherInteriorDataFromAudioVolumesCVar = 1;
FAutoConsoleVariableRef CVarGatherInteriorDataFromAudioVolumes(
	TEXT("au.InteriorData.UseAudioVolumes"),
	GatherInteriorDataFromAudioVolumesCVar,
	TEXT("When set to 1, allows gathering of interior data from audio volumes (Legacy).\n")
	TEXT("0: Disabled, 1: Enabled (default)"),
	ECVF_Default);

static int32 GatherInteriorDataFromIActiveSoundUpdateCVar = 1;
FAutoConsoleVariableRef CVarGatherInteriorDataFromIActiveSoundUpdate(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ActiveSound.cpp:795

Scope (from outer to inner):

file
function     void FActiveSound::UpdateWaveInstances

Source code excerpt:

		// If we aren't in a world there is no interior volumes to be handled.
		const bool bNeedsInteriorUpdate = (!bGotInteriorSettings || (ParseParams.Transform.GetTranslation() - LastLocation).SizeSquared() > UE_KINDA_SMALL_NUMBER);
		const bool bUseAudioVolumes = GatherInteriorDataFromAudioVolumesCVar != 0;
		const bool bUseActiveSoundUpdate = GatherInteriorDataFromIActiveSoundUpdateCVar != 0;

		// Gather data from interior spaces
		if (bNeedsInteriorUpdate)
		{
			if (bUseAudioVolumes)