au.DisableHPFiltering

au.DisableHPFiltering

#Overview

name: au.DisableHPFiltering

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.DisableHPFiltering is to control whether the per-source high-pass filter is disabled in the audio mixing system of Unreal Engine 5.

This setting variable is primarily used in the Audio Mixer subsystem of Unreal Engine 5, specifically within the Source Manager component. It affects the audio processing pipeline for individual sound sources.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as a boolean flag, where 0 means the high-pass filter is enabled (not disabled), and 1 means it’s disabled.

The associated variable DisableHPFilteringCvar directly interacts with au.DisableHPFiltering. They share the same value, with DisableHPFilteringCvar being the actual integer variable used in the C++ code to check the filter’s status.

Developers must be aware that disabling the high-pass filter can affect the audio quality and performance of the game. The high-pass filter is typically used to remove low-frequency noise or rumble from audio sources, so disabling it might introduce unwanted low-frequency content in the final audio output.

Best practices when using this variable include:

  1. Only disable the high-pass filter if there’s a specific need or performance issue.
  2. Test thoroughly after changing this setting to ensure audio quality isn’t negatively impacted.
  3. Consider the target platform and hardware capabilities when deciding whether to disable this filter.

Regarding the associated variable DisableHPFilteringCvar:

The purpose of DisableHPFilteringCvar is to provide a C++ accessible representation of the au.DisableHPFiltering console variable.

It’s used directly in the Audio Mixer Source Manager to determine whether to bypass the high-pass filter during audio processing.

The value of DisableHPFilteringCvar is set automatically by the console variable system when au.DisableHPFiltering is changed.

This variable interacts closely with au.DisableHPFiltering and is used in conjunction with other filtering-related variables like DisableFilteringCvar.

Developers should be aware that this variable is used in performance-critical audio processing loops, so frequent changes or checks against this variable could potentially impact performance.

Best practices for using DisableHPFilteringCvar include:

  1. Treat it as read-only in most cases, as it’s automatically updated by the console variable system.
  2. If performance is critical, consider caching its value rather than checking it repeatedly in tight loops.
  3. When debugging audio issues, check this variable’s state to understand if high-pass filtering is currently active.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static int32 DisableHPFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableHPFiltering(
	TEXT("au.DisableHPFiltering"),
	DisableHPFilteringCvar,
	TEXT("Disables using the per-source highpass filter.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableEnvelopeFollowingCvar = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 DisableHPFilteringCvar = 0;
FAutoConsoleVariableRef CVarDisableHPFiltering(
	TEXT("au.DisableHPFiltering"),
	DisableHPFilteringCvar,
	TEXT("Disables using the per-source highpass filter.\n")
	TEXT("0: Not Disabled, 1: Disabled"),
	ECVF_Default);

static int32 DisableEnvelopeFollowingCvar = 0;
FAutoConsoleVariableRef CVarDisableEnvelopeFollowing(

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

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerSourceManager::ComputePostSourceEffectBufferForIdRange

Source code excerpt:


				const bool bBypassLPF = DisableFilteringCvar || (SourceInfo.LowPassFilter.GetCutoffFrequency() >= (MAX_FILTER_FREQUENCY - KINDA_SMALL_NUMBER));
				const bool bBypassHPF = DisableFilteringCvar || DisableHPFilteringCvar || (SourceInfo.HighPassFilter.GetCutoffFrequency() <= (MIN_FILTER_FREQUENCY + KINDA_SMALL_NUMBER));

				float* SourceBuffer = SourceInfo.SourceBuffer.GetData();
				float* HpfInputBuffer = PreDistanceAttenBufferPtr; // assume bypassing LPF (HPF uses input buffer as input)

				if (!bBypassLPF)
				{