bAllowCenterChannel3DPanning

bAllowCenterChannel3DPanning

#Overview

name: bAllowCenterChannel3DPanning

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

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bAllowCenterChannel3DPanning is to control whether the center channel is included in 3D panning calculations for surround sound spatialization. This setting is primarily used in the audio rendering system of Unreal Engine 5.

The Unreal Engine audio subsystem, specifically the AudioMixer module, relies on this setting variable. It is used in the FMixerDevice class, which is part of the core audio mixing functionality.

The value of this variable is set in the UAudioSettings class, which is a part of the Engine module. It can be configured through the project settings in the Unreal Editor.

This variable interacts with the channel azimuth map initialization process. When enabled, it allows the center channel (EAudioMixerChannel::FrontCenter) to be included in the azimuth computations for 3D audio positioning.

Developers must be aware that enabling this setting can change the perceived audio positioning in surround sound setups. It may affect the balance and directionality of audio, particularly for content that heavily relies on the center channel (e.g., dialogue in cinematic scenes).

Best practices when using this variable include:

  1. Consider the target audio setup for your game (stereo, 5.1, 7.1, etc.) when deciding whether to enable this setting.
  2. Test the audio positioning with and without this setting enabled to ensure it provides the desired effect for your specific audio content.
  3. Be consistent in its usage throughout the project to maintain a coherent audio experience.
  4. Document the chosen setting and its implications for the audio team to ensure everyone understands how it affects the overall sound design.

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:262, section: [/Script/Engine.AudioSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerChannelMaps.cpp:221

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerDevice::InitializeChannelAzimuthMap

Source code excerpt:

		}

		if (bAllowCenterChannel3DPanning)
		{
			// Allow center channel for azimuth computations
			DefaultChannelAzimuthPositions[EAudioMixerChannel::FrontCenter] = { EAudioMixerChannel::FrontCenter, 0 };
		}
		else
		{

#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerChannelMaps.cpp:252

Scope (from outer to inner):

file
namespace    Audio
function     void FMixerDevice::InitializeChannelAzimuthMap

Source code excerpt:

				
				// Don't allow overriding the center channel if its not allowed to spatialize.
				if (MixerChannelType != EAudioMixerChannel::FrontCenter || bAllowCenterChannel3DPanning)
				{
					const TCHAR* ChannelName = EAudioMixerChannel::ToString(MixerChannelType);
					if (GConfig->GetInt(TEXT("AudioChannelAzimuthMap"), ChannelName, AzimuthPositionOverride, GEngineIni))
					{
						if (AzimuthPositionOverride >= 0 && AzimuthPositionOverride < 360)
						{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Sound/AudioSettings.h:209

Scope (from outer to inner):

file
class        class UAudioSettings : public UDeveloperSettings

Source code excerpt:

	/** Enables the surround sound spatialization calculations to include the center channel. */
	UPROPERTY(config, EditAnywhere, Category = "Panning", AdvancedDisplay)
	uint32 bAllowCenterChannel3DPanning : 1;

	/**
	 * The max number of sources to reserve for "stopping" sounds. A "stopping" sound applies a fast fade in the DSP
	 * render to prevent discontinuities when stopping sources.
	 */
	UPROPERTY(config, EditAnywhere, Category = "Audio", AdvancedDisplay)

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

Scope (from outer to inner):

file
function     FAudioDevice::FAudioDevice

Source code excerpt:

	, bIsInitialized(false)
	, AudioClock(0.0)
	, bAllowCenterChannel3DPanning(false)
	, DeviceDeltaTime(0.0f)
	, bHasActivatedReverb(false)
	, bAllowPlayWhenSilent(true)
	, bUseAttenuationForNonGameWorlds(false)
	, ConcurrencyManager(this)
	, OneShotCount(0)

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

Scope (from outer to inner):

file
function     bool FAudioDevice::Init

Source code excerpt:

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

	const FSoftObjectPath DefaultBaseSoundMixName = GetDefault<UAudioSettings>()->DefaultBaseSoundMix;
	if (DefaultBaseSoundMixName.IsValid())
	{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/AudioDevice.h:2187

Scope (from outer to inner):

file
class        class FAudioDevice : public FExec

Source code excerpt:


	/** Whether or not we allow center channel panning (audio mixer only feature.) */
	uint8 bAllowCenterChannel3DPanning : 1;

	float DeviceDeltaTime;

	/** Whether the device was initialized. */
	FORCEINLINE bool IsInitialized() const { return bIsInitialized; }