Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation

Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation

#Overview

name: Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation

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 Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation is to control whether audio synchronization should be ignored when world time dilation is applied in Unreal Engine’s Sequencer system.

This setting variable is primarily used in the audio system of Unreal Engine’s Sequencer module, which is part of the MovieSceneTracks runtime. It specifically affects the behavior of audio playback when time dilation is applied to the world.

The value of this variable is set through the Unreal Engine console variable system. It is defined as a boolean value with a default setting of true, meaning that by default, audio sync correction is ignored when world time dilation is active.

The associated variable bIgnoreAudioSyncDuringWorldTimeDilationCVar directly interacts with this setting. They share the same value, and bIgnoreAudioSyncDuringWorldTimeDilationCVar is used in the actual code logic to determine whether to perform audio synchronization.

Developers must be aware that this variable affects how audio behaves in sequences when world time dilation is applied. When set to true, it will prevent audio from being corrected to match the dilated time, which may result in audio being out of sync with other elements in the sequence.

Best practices when using this variable include:

  1. Consider the impact on audio-visual synchronization in sequences when world time dilation is used.
  2. Test sequences with different time dilation values to ensure desired audio behavior.
  3. Be prepared to toggle this setting if precise audio synchronization is required during time dilation.

Regarding the associated variable bIgnoreAudioSyncDuringWorldTimeDilationCVar:

The purpose of bIgnoreAudioSyncDuringWorldTimeDilationCVar is to provide a runtime boolean flag that reflects the console variable setting.

This variable is used directly in the MovieSceneAudioSystem module, specifically in the EnsureAudioIsPlaying function. It determines whether time synchronization should be performed for audio playback when world time dilation is not equal to 1.

The value of this variable is set by the console variable system when Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation is modified.

This variable interacts closely with the World’s time dilation settings and the audio playback system.

Developers should be aware that this variable directly affects the behavior of the EnsureAudioIsPlaying function, which is crucial for maintaining audio synchronization in sequences.

Best practices for using this variable include:

  1. Understand its relationship with the console variable and how changes to one affect the other.
  2. Consider the implications on audio behavior when modifying this variable during runtime.
  3. Use this variable in conjunction with other audio and sequencer settings to achieve the desired audio synchronization behavior.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/MovieSceneTracks/Private/Systems/MovieSceneAudioSystem.cpp:32

Scope: file

Source code excerpt:

static bool bIgnoreAudioSyncDuringWorldTimeDilationCVar = true;
FAutoConsoleVariableRef CVarIgnoreAudioSyncDuringWorldTimeDilation(
	TEXT("Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation"),
	bIgnoreAudioSyncDuringWorldTimeDilationCVar,
	TEXT("Ignore correcting audio if there is world time dilation.\n"),
	ECVF_Default);

static int32 UseAudioClockForSequencerDesyncCVar = 0;
FAutoConsoleVariableRef CVaUseAudioClockForSequencerDesync(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/MovieSceneTracks/Private/Systems/MovieSceneAudioSystem.cpp:30

Scope: file

Source code excerpt:

	ECVF_Default);

static bool bIgnoreAudioSyncDuringWorldTimeDilationCVar = true;
FAutoConsoleVariableRef CVarIgnoreAudioSyncDuringWorldTimeDilation(
	TEXT("Sequencer.Audio.IgnoreAudioSyncDuringWorldTimeDilation"),
	bIgnoreAudioSyncDuringWorldTimeDilationCVar,
	TEXT("Ignore correcting audio if there is world time dilation.\n"),
	ECVF_Default);

static int32 UseAudioClockForSequencerDesyncCVar = 0;
FAutoConsoleVariableRef CVaUseAudioClockForSequencerDesync(
	TEXT("Sequencer.Audio.UseAudioClockForAudioDesync"),

#Loc: <Workspace>/Engine/Source/Runtime/MovieSceneTracks/Private/Systems/MovieSceneAudioSystem.cpp:529

Scope (from outer to inner):

file
namespace    UE::MovieScene
function     void EnsureAudioIsPlaying

Source code excerpt:

			World && World->GetWorldSettings() &&
			(FMath::IsNearlyEqual(World->GetWorldSettings()->GetEffectiveTimeDilation(), 1.f) ||
			 !bIgnoreAudioSyncDuringWorldTimeDilationCVar);

		if (bDoTimeSync)
		{
			float CurrentGameTime = 0.0f;

			FAudioDevice* AudioDevice = World ? World->GetAudioDeviceRaw() : nullptr;