au.editor.CookOverrideCachingInterval

au.editor.CookOverrideCachingInterval

#Overview

name: au.editor.CookOverrideCachingInterval

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.editor.CookOverrideCachingInterval is to control the maximum latency between when a cook override for audio compression settings is changed in the project settings and when it is applied to new audio sources in the Unreal Engine editor.

This setting variable is primarily used in the audio system of Unreal Engine, specifically for managing audio compression settings and cook overrides.

The value of this variable is set through the Unreal Engine console variable system. It is initialized with a default value of 60.0 seconds and can be modified at runtime using console commands.

The associated variable CookOverrideCachingIntervalCvar directly interacts with au.editor.CookOverrideCachingInterval. They share the same value, with CookOverrideCachingIntervalCvar being the actual float variable used in the code.

Developers should be aware that this variable affects the responsiveness of applying cook override changes to new audio sources. A lower value will result in more frequent updates but may impact performance, while a higher value might introduce a delay in applying changes.

Best practices when using this variable include:

  1. Adjusting the value based on the project’s needs for balancing between responsiveness and performance.
  2. Monitoring the impact of different values on editor performance, especially in projects with many audio assets.
  3. Considering temporarily lowering the value during active audio settings development for quicker feedback.

Regarding the associated variable CookOverrideCachingIntervalCvar:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:22

Scope: file

Source code excerpt:

static float CookOverrideCachingIntervalCvar = 60.0f;
FAutoConsoleVariableRef CVarCookOverrideCachingIntervalCVar(
	TEXT("au.editor.CookOverrideCachingInterval"),
	CookOverrideCachingIntervalCvar,
	TEXT("This sets the max latency between when a cook override is changed in the project settings and when it is applied to new audio sources.\n")
	TEXT("n: Time between caching intervals, in seconds."),
	ECVF_Default);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:20

Scope: file

Source code excerpt:

#include "Misc/ConfigCacheIni.h"

static float CookOverrideCachingIntervalCvar = 60.0f;
FAutoConsoleVariableRef CVarCookOverrideCachingIntervalCVar(
	TEXT("au.editor.CookOverrideCachingInterval"),
	CookOverrideCachingIntervalCvar,
	TEXT("This sets the max latency between when a cook override is changed in the project settings and when it is applied to new audio sources.\n")
	TEXT("n: Time between caching intervals, in seconds."),
	ECVF_Default);


/**

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioCompressionSettingsUtils.cpp:307

Scope (from outer to inner):

file
function     const FPlatformAudioCookOverrides* FPlatformCompressionUtilities::GetCookOverrides

Source code excerpt:

		double TimeSinceLastCache = CurrentTime - LastCacheTime;

		if (bForceRecache || TimeSinceLastCache > CookOverrideCachingIntervalCvar)
		{
			bNeedsToBeInitialized = true;
			LastCacheTime = CurrentTime;
		}
	}
#endif