au.Submix.Effects.DynamicsProcessor.Bypass

au.Submix.Effects.DynamicsProcessor.Bypass

#Overview

name: au.Submix.Effects.DynamicsProcessor.Bypass

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.Submix.Effects.DynamicsProcessor.Bypass is to provide a runtime toggle for bypassing all active submix dynamics processors in the Unreal Engine audio system. This setting variable is part of the audio mixing and effects subsystem.

The Unreal Engine audio mixer module relies on this setting variable, specifically within the submix effects processing pipeline. It’s used in the FSubmixEffectDynamicsProcessor class, which is responsible for applying dynamics processing effects to audio submixes.

The value of this variable is set through the Unreal Engine Console Variable (CVar) system. It’s initialized as a static integer with a default value of 0 and then bound to the console variable “au.Submix.Effects.DynamicsProcessor.Bypass” using FAutoConsoleVariableRef.

This variable interacts directly with the associated variable bBypassSubmixDynamicsProcessor. They share the same value, with the console variable acting as an external interface to control the internal state.

Developers must be aware that setting this variable to a non-zero value will bypass all submix dynamics processors currently active in the game. This can significantly affect the audio output and should be used carefully, primarily for debugging or performance testing purposes.

Best practices when using this variable include:

  1. Using it temporarily for debugging or testing, not as a permanent solution in production code.
  2. Resetting it to 0 after testing to ensure normal audio processing resumes.
  3. Being aware that it affects all submix dynamics processors globally, not individual instances.

Regarding the associated variable bBypassSubmixDynamicsProcessor:

The purpose of bBypassSubmixDynamicsProcessor is to serve as the internal flag that controls the bypassing of submix dynamics processors. It’s the actual variable used in the audio processing code to determine whether to apply the dynamics processing or not.

This variable is used within the FSubmixEffectDynamicsProcessor::OnProcessAudio function. When either bBypassSubmixDynamicsProcessor or the instance-specific bBypass flag is true, the function will simply copy the input audio to the output without applying any dynamics processing.

Developers should be aware that modifying bBypassSubmixDynamicsProcessor directly in code is not recommended. Instead, they should use the console variable “au.Submix.Effects.DynamicsProcessor.Bypass” to control this behavior, ensuring consistency between the external interface and internal state.

Best practices for bBypassSubmixDynamicsProcessor include:

  1. Treating it as a read-only variable in most code contexts.
  2. Using the console variable for any runtime toggling of the bypass functionality.
  3. Being aware of its state when debugging audio issues, as it can significantly impact audio behavior.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Effects/AudioMixerSubmixEffectDynamicsProcessor.cpp:18

Scope: file

Source code excerpt:

static int32 bBypassSubmixDynamicsProcessor = 0;
FAutoConsoleVariableRef CVarBypassDynamicsProcessor(
	TEXT("au.Submix.Effects.DynamicsProcessor.Bypass"),
	bBypassSubmixDynamicsProcessor,
	TEXT("If non-zero, bypasses all submix dynamics processors currently active.\n"),
	ECVF_Default);

FSubmixEffectDynamicsProcessor::FSubmixEffectDynamicsProcessor()
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Effects/AudioMixerSubmixEffectDynamicsProcessor.cpp:16

Scope: file

Source code excerpt:

DEFINE_STAT(STAT_AudioMixerSubmixDynamics);

static int32 bBypassSubmixDynamicsProcessor = 0;
FAutoConsoleVariableRef CVarBypassDynamicsProcessor(
	TEXT("au.Submix.Effects.DynamicsProcessor.Bypass"),
	bBypassSubmixDynamicsProcessor,
	TEXT("If non-zero, bypasses all submix dynamics processors currently active.\n"),
	ECVF_Default);

FSubmixEffectDynamicsProcessor::FSubmixEffectDynamicsProcessor()
{
	DeviceCreatedHandle = FAudioDeviceManagerDelegates::OnAudioDeviceCreated.AddRaw(this, &FSubmixEffectDynamicsProcessor::OnDeviceCreated);

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/Effects/AudioMixerSubmixEffectDynamicsProcessor.cpp:256

Scope (from outer to inner):

file
function     void FSubmixEffectDynamicsProcessor::OnProcessAudio

Source code excerpt:

	Audio::FAlignedFloatBuffer& OutBuffer = *OutData.AudioBuffer;

	if (bBypassSubmixDynamicsProcessor || bBypass)
	{
		FMemory::Memcpy(OutBuffer.GetData(), InBuffer.GetData(), sizeof(float) * InBuffer.Num());
		return;
	}

	int32 NumKeyChannels = DynamicsProcessor.GetKeyNumChannels();