Editor.AsyncSoundWaveCompilation

Editor.AsyncSoundWaveCompilation

#Overview

name: Editor.AsyncSoundWaveCompilation

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of Editor.AsyncSoundWaveCompilation is to enable asynchronous compilation of sound wave assets in Unreal Engine 5. This setting is used to improve import and map load time performance when sound wave compilation is required.

This setting variable is primarily used by the Engine module, specifically within the SoundWaveCompiler subsystem. It’s part of the editor’s experimental settings, indicating that it’s a feature that may still be in development or testing phases.

The value of this variable is set in the UEditorExperimentalSettings class, which is part of the UnrealEd module. It’s associated with the bEnableAsyncSoundWaveCompilation boolean property in this class.

The variable interacts with other async compilation settings in the engine, such as those for static meshes and skeletal meshes. It’s part of a broader system for asynchronous asset compilation in Unreal Engine.

Developers should be aware that:

  1. This is an experimental feature, so it may not be fully stable or optimized.
  2. Enabling this feature could potentially impact editor performance, especially on less powerful hardware.
  3. It may affect the behavior of sound wave assets during development, so thorough testing is advisable.

Best practices when using this variable include:

  1. Enable it in projects with a large number of sound assets to potentially improve load times.
  2. Monitor performance and stability after enabling to ensure it’s beneficial for your specific project.
  3. Keep it disabled if you’re not experiencing performance issues with sound wave compilation.

Regarding the associated variable bEnableAsyncSoundWaveCompilation:

This is a boolean property in the UEditorExperimentalSettings class. Its purpose is to store the user’s preference for enabling or disabling asynchronous sound wave compilation. It’s directly tied to the Editor.AsyncSoundWaveCompilation console variable.

This variable is set through the Editor’s Project Settings interface, under the Experimental category. It’s used by the engine to determine whether to use async compilation for sound waves.

Developers should be aware that changes to this setting may require an editor restart to take full effect. It’s also important to note that this setting is part of the experimental features, so its behavior or presence may change in future engine versions.

Best practices for using bEnableAsyncSoundWaveCompilation include:

  1. Consider enabling it in projects with many sound assets or long load times.
  2. Test thoroughly after enabling to ensure it doesn’t introduce any unexpected behavior in your sound system.
  3. Be prepared to disable it if you encounter any issues with sound asset compilation or playback.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWaveCompiler.cpp:49

Scope (from outer to inner):

file
namespace    SoundWaveCompilingManagerImpl
function     static void EnsureInitializedCVars

Source code excerpt:


			AsyncCompilationHelpers::EnsureInitializedCVars(
				TEXT("SoundWave"),
				CVarAsyncSoundWaveStandard.AsyncCompilation,
				CVarAsyncSoundWaveStandard.AsyncCompilationMaxConcurrency,
				GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncSoundWaveCompilation));
		}
	}
}

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/EditorExperimentalSettings.h:27

Scope (from outer to inner):

file
class        class UEditorExperimentalSettings : public UObject

Source code excerpt:

	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async static mesh compilation and loading"))
	bool bEnableAsyncStaticMeshCompilation;

	/** Enable async skeletal mesh compilation to improve import and map load time performance when compilation is required */
	UE_DEPRECATED(5.1, "Deprecated & replaced by bEnableAsyncSkinnedAssetCompilation.")
	UPROPERTY(/*EditAnywhere - deprecated & replaced by bEnableAsyncSkinnedAssetCompilation, */config/*, Category = Performance, meta = (DisplayName = "Enable async skeletal mesh compilation and loading")*/)
	bool bEnableAsyncSkeletalMeshCompilation;

	/** Enable async skinned asset compilation to improve import and map load time performance when compilation is required */
	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async skinned asset compilation and loading"))
	bool bEnableAsyncSkinnedAssetCompilation;

	/** Enable async sound compilation to improve import and map load time performance when compilation is required */
	UPROPERTY(EditAnywhere, config, Category = Performance, meta = (DisplayName = "Enable async sound compilation and loading"))
	bool bEnableAsyncSoundWaveCompilation;

	/** Allows the editor to run on HDR monitors on Windows 10 */
	UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ConfigRestartRequired = true, DisplayName = "Enable Editor Support for HDR Monitors"))
	bool bHDREditor;

	/** The brightness of the slate UI on HDR monitors */
	UPROPERTY(EditAnywhere, config, Category = HDR, meta = (ClampMin = "100.0", ClampMax = "300.0", UIMin = "100.0", UIMax = "300.0"))
	float HDREditorNITLevel;

	/** Allows usage of the procedural foliage system */
	UPROPERTY(EditAnywhere, config, Category = Foliage, meta = (DisplayName = "Procedural Foliage"))
	bool bProceduralFoliage;

	/** Allows usage of the Translation Picker */
	UPROPERTY(EditAnywhere, config, Category = Tools, meta = (DisplayName = "Translation Picker"))
	bool bEnableTranslationPicker;

	/** Specify which console-specific nomenclature to use for gamepad label text */
	UPROPERTY(EditAnywhere, config, Category=UserInterface, meta=(DisplayName="Console for Gamepad Labels"))
	TEnumAsByte<EConsoleForGamepadLabels::Type> ConsoleForGamepadLabels;

	/** Allows for customization of toolbars and menus throughout the editor */
	UPROPERTY(config)
	bool bToolbarCustomization;

	/** Break on Exceptions allows you to trap Access Nones and other exceptional events in Blueprints. */

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:175

Scope (from outer to inner):

file
function     UEditorExperimentalSettings::UEditorExperimentalSettings

Source code excerpt:

	ECVF_Default);

static TAutoConsoleVariable<float> CVarEditorHDRNITLevel(
	TEXT("Editor.HDRNITLevel"),
	160.0f,
	TEXT("Sets The desired NIT level of the editor when running on HDR"),
	ECVF_Default);

UEditorExperimentalSettings::UEditorExperimentalSettings( const FObjectInitializer& ObjectInitializer )
	: Super(ObjectInitializer)
	, bEnableAsyncTextureCompilation(false)
	, bEnableAsyncStaticMeshCompilation(false)
	, bEnableAsyncSkeletalMeshCompilation(true)	// This was false and set to True in /Engine/Config/BaseEditorPerProjectUserSettings.ini. The setting is removed from .ini so change it to default True.
	, bEnableAsyncSkinnedAssetCompilation(false)
	, bEnableAsyncSoundWaveCompilation(false)
	, bHDREditor(false)
	, HDREditorNITLevel(160.0f)
	, bUseOpenCLForConvexHullDecomp(false)
	, bAllowPotentiallyUnsafePropertyEditing(false)
	, bPackedLevelActor(true)
	, bLevelInstance(true)
{
}

void UEditorExperimentalSettings::PostInitProperties()
{
	PRAGMA_DISABLE_DEPRECATION_WARNINGS
	// bEnableAsyncSkeletalMeshCompilation's default to True (see comment in constructor above).
	// To be backwards compatible, if a user project overrides it to False, pass on the value to bEnableAsyncSkinnedAssetCompilation.
	if (!bEnableAsyncSkeletalMeshCompilation)
	{
		UE_LOG(LogSettingsClasses, Warning, TEXT("bEnableAsyncSkeletalMeshCompilation is deprecated and replaced with bEnableAsyncSkinnedAssetCompilation. Please update the config. Setting bEnableAsyncSkinnedAssetCompilation to False."));
		bEnableAsyncSkinnedAssetCompilation = false;
	}
	PRAGMA_ENABLE_DEPRECATION_WARNINGS

	CVarEditorHDRSupport->Set(bHDREditor ? 1 : 0, ECVF_SetByProjectSetting);
	CVarEditorHDRNITLevel->Set(HDREditorNITLevel, ECVF_SetByProjectSetting);
	Super::PostInitProperties();
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWaveCompiler.cpp:40

Scope (from outer to inner):

file
namespace    SoundWaveCompilingManagerImpl
function     static void EnsureInitializedCVars

Source code excerpt:

	}

	static void EnsureInitializedCVars()
	{
		static bool bIsInitialized = false;

		if (!bIsInitialized)
		{
			bIsInitialized = true;

			AsyncCompilationHelpers::EnsureInitializedCVars(
				TEXT("SoundWave"),
				CVarAsyncSoundWaveStandard.AsyncCompilation,
				CVarAsyncSoundWaveStandard.AsyncCompilationMaxConcurrency,
				GET_MEMBER_NAME_CHECKED(UEditorExperimentalSettings, bEnableAsyncSoundWaveCompilation));
		}
	}
}

FSoundWaveCompilingManager::FSoundWaveCompilingManager()
	: Notification(MakeUnique<FAsyncCompilationNotification>(GetAssetNameFormat()))
{
	SoundWaveCompilingManagerImpl::EnsureInitializedCVars();
}

FName FSoundWaveCompilingManager::GetStaticAssetTypeName()
{
	return TEXT("UE-SoundWave");
}

FName FSoundWaveCompilingManager::GetAssetTypeName() const
{
	return GetStaticAssetTypeName();
}

TArrayView<FName> FSoundWaveCompilingManager::GetDependentTypeNames() const
{
	return TArrayView<FName>{ };
}

FTextFormat FSoundWaveCompilingManager::GetAssetNameFormat() const