au.BakedAnalysisEnabled

au.BakedAnalysisEnabled

#Overview

name: au.BakedAnalysisEnabled

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.BakedAnalysisEnabled is to control whether queries to baked analysis from audio components are enabled or disabled in Unreal Engine’s audio system.

This setting variable is primarily used by the audio system within Unreal Engine. Based on the callsites, it’s clear that this variable is part of the Engine module, specifically within the AudioDevice functionality.

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

The au.BakedAnalysisEnabled variable interacts directly with the associated variable BakedAnalysisEnabledCVar. They share the same value, with BakedAnalysisEnabledCVar being the actual integer storage and au.BakedAnalysisEnabled being the console-accessible name.

Developers should be aware that this variable affects the behavior of audio components regarding baked analysis queries. When enabled (set to 1), audio components can query baked analysis data, which might be crucial for certain audio features or optimizations.

Best practices when using this variable include:

  1. Only disable it if you’re certain you don’t need baked analysis functionality in your audio system.
  2. Be aware that changing this value at runtime might affect ongoing audio processes.
  3. Consider the performance implications of enabling or disabling baked analysis.

Regarding the associated variable BakedAnalysisEnabledCVar:

The purpose of BakedAnalysisEnabledCVar is to store the actual integer value that determines whether baked analysis is enabled or disabled.

This variable is used within the FAudioDevice class, which is part of the core audio system in Unreal Engine.

The value of BakedAnalysisEnabledCVar is set initially to 1, but it can be modified through the au.BakedAnalysisEnabled console variable.

BakedAnalysisEnabledCVar interacts directly with the boolean bIsBakedAnalysisEnabled within the FAudioDevice class. The audio device updates this boolean based on the value of BakedAnalysisEnabledCVar.

Developers should be aware that changes to BakedAnalysisEnabledCVar will affect the bIsBakedAnalysisEnabled flag in the audio device, which likely controls the behavior of various audio processing functions.

Best practices for BakedAnalysisEnabledCVar include:

  1. Avoid directly modifying this variable; instead, use the au.BakedAnalysisEnabled console variable to ensure proper synchronization.
  2. Be mindful of the performance implications when changing this value, especially in performance-critical sections of your game.
  3. Consider logging or debugging when this value changes to track its impact on audio behavior.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:112

Scope: file

Source code excerpt:

static int32 BakedAnalysisEnabledCVar = 1;
FAutoConsoleVariableRef CVarBakedAnalysisEnabledCVar(
	TEXT("au.BakedAnalysisEnabled"),
	BakedAnalysisEnabledCVar,
	TEXT("Enables or disables queries to baked analysis from audio component.\n"),
	ECVF_Default);

static int32 NumPrecacheFramesCvar = 0;
FAutoConsoleVariableRef CVarNumPrecacheFrames(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:110

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 BakedAnalysisEnabledCVar = 1;
FAutoConsoleVariableRef CVarBakedAnalysisEnabledCVar(
	TEXT("au.BakedAnalysisEnabled"),
	BakedAnalysisEnabledCVar,
	TEXT("Enables or disables queries to baked analysis from audio component.\n"),
	ECVF_Default);

static int32 NumPrecacheFramesCvar = 0;
FAutoConsoleVariableRef CVarNumPrecacheFrames(
	TEXT("au.NumPrecacheFrames"),

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:517

Scope (from outer to inner):

file
function     bool FAudioDevice::Init

Source code excerpt:

	bIsStoppingVoicesEnabled = !DisableStoppingVoicesCvar;

	bIsBakedAnalysisEnabled = (BakedAnalysisEnabledCVar == 1);

	const UAudioSettings* AudioSettings = GetDefault<UAudioSettings>();

	GlobalMinPitch = FMath::Max(AudioSettings->GlobalMinPitchScale, 0.0001f);
	GlobalMaxPitch = FMath::Max(AudioSettings->GlobalMaxPitchScale, 0.0001f);
	bAllowCenterChannel3DPanning = AudioSettings->bAllowCenterChannel3DPanning;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDevice.cpp:4650

Scope (from outer to inner):

file
function     void FAudioDevice::Update

Source code excerpt:


	// update if baked analysis is enabled
	bIsBakedAnalysisEnabled = (BakedAnalysisEnabledCVar == 1);

	if (bGameTicking)
	{
		GlobalPitchScale.Update(GetDeviceDeltaTime());
	}