au.DisableEnvelopeFollowing

au.DisableEnvelopeFollowing

#Overview

name: au.DisableEnvelopeFollowing

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

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.DisableEnvelopeFollowing is to control the usage of envelope following for source envelope tracking in the audio mixer system of Unreal Engine 5.

This setting variable is primarily used by the Audio Mixer subsystem, specifically within the Source Manager component. It’s part of the audio processing pipeline that handles individual sound sources.

The value of this variable is set through a console variable (CVar) system, which allows for runtime configuration. It’s initialized to 0 (not disabled) by default, but can be changed during runtime or through configuration files.

The associated variable DisableEnvelopeFollowingCvar directly interacts with au.DisableEnvelopeFollowing. They share the same value, with DisableEnvelopeFollowingCvar being the actual integer variable used in the code, while au.DisableEnvelopeFollowing is the console command to modify it.

Developers must be aware that:

  1. This variable is a boolean flag (0 or 1).
  2. When set to 1, it disables the envelope follower for source envelope tracking.
  3. Disabling this feature may affect audio quality or behavior, particularly for effects that rely on envelope information.

Best practices when using this variable include:

  1. Only disable envelope following if there’s a specific performance issue or if the envelope tracking is causing unwanted audio artifacts.
  2. Test thoroughly after changing this setting, as it may have wide-reaching effects on audio behavior.
  3. Consider the impact on any custom audio processing that might rely on envelope information.

Regarding the associated variable DisableEnvelopeFollowingCvar:

The purpose of DisableEnvelopeFollowingCvar is to serve as the actual storage for the au.DisableEnvelopeFollowing setting within the C++ code.

This variable is used directly in the AudioMixer subsystem, specifically in the FMixerSourceManager class.

The value of DisableEnvelopeFollowingCvar is set through the CVar system, mirroring au.DisableEnvelopeFollowing.

It interacts directly with the audio processing logic, determining whether envelope following should be performed.

Developers should be aware that this is the actual variable checked in the code, so any runtime changes to au.DisableEnvelopeFollowing will be reflected here.

Best practices include:

  1. Treat this variable as read-only within the code, modifying it only through the CVar system.
  2. Use this variable for conditional logic related to envelope following in audio processing code.
  3. Be cautious about introducing any direct modifications to this variable, as it could lead to inconsistent behavior with the CVar system.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/Android/AndroidEngine.ini:12, section: [ConsoleVariables]

Location: <Workspace>/Projects/Lyra/Config/IOS/IOSEngine.ini:7, section: [ConsoleVariables]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:55

Scope: file

Source code excerpt:

static int32 DisableEnvelopeFollowingCvar = 0;
FAutoConsoleVariableRef CVarDisableEnvelopeFollowing(
	TEXT("au.DisableEnvelopeFollowing"),
	DisableEnvelopeFollowingCvar,
	TEXT("Disables using the envlope follower for source envelope tracking.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableSourceEffectsCvar = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:53

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 DisableEnvelopeFollowingCvar = 0;
FAutoConsoleVariableRef CVarDisableEnvelopeFollowing(
	TEXT("au.DisableEnvelopeFollowing"),
	DisableEnvelopeFollowingCvar,
	TEXT("Disables using the envlope follower for source envelope tracking.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableSourceEffectsCvar = 0;
FAutoConsoleVariableRef CVarDisableSourceEffects(

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSourceManager.cpp:2817

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSourceManager::ComputePostSourceEffectBufferForIdRange

Source code excerpt:

			const bool bWasEffectTailsDone = SourceInfo.bEffectTailsDone;

			if (!DisableEnvelopeFollowingCvar)
			{
				// Compute the source envelope using pre-distance attenuation buffer
				float AverageSampleValue = Audio::ArrayGetAverageAbsValue(PreDistanceAttenBufferView);
				SourceInfo.SourceEnvelopeValue = SourceInfo.SourceEnvelopeFollower.ProcessSample(AverageSampleValue);
				SourceInfo.SourceEnvelopeValue = FMath::Clamp(SourceInfo.SourceEnvelopeValue, 0.f, 1.f);