au.editor.ForceAudioNonStreaming
au.editor.ForceAudioNonStreaming
#Overview
name: au.editor.ForceAudioNonStreaming
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When set to 1, forces any audio played to be non-streaming May force a DDC miss.\n0: Honor the Play When Silent flag, 1: stop all silent non-procedural sources.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.editor.ForceAudioNonStreaming is to control audio streaming behavior in the Unreal Engine editor. It is primarily used in the audio system to force non-streaming playback of audio assets.
This setting variable is utilized by the Unreal Engine’s audio system, specifically within the Engine module. It’s referenced in the SoundWave.cpp file, which is part of the core audio functionality.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 and can be changed at runtime through console commands or project settings.
The associated variable ForceNonStreamingInEditorCVar directly interacts with au.editor.ForceAudioNonStreaming. They share the same value, with ForceNonStreamingInEditorCVar being the actual integer storage for the setting.
Developers must be aware that enabling this setting (setting it to 1) will force all audio played in the editor to be non-streaming. This can have performance implications, especially for larger audio files that would normally be streamed. It may also cause a DDC (Derived Data Cache) miss, which could impact asset loading times.
Best practices when using this variable include:
- Only enable it when necessary for debugging or specific development scenarios.
- Be cautious of memory usage when enabled, as all audio will be loaded entirely into memory.
- Remember to disable it before final builds or when not needed to ensure optimal performance.
Regarding the associated variable ForceNonStreamingInEditorCVar:
- Its purpose is to act as the actual storage for the au.editor.ForceAudioNonStreaming setting.
- It’s used within the USoundWave::IsStreaming function to determine if audio should be forced to non-streaming mode in the editor.
- The value is set through the CVar system, initialized to 0.
- It interacts directly with au.editor.ForceAudioNonStreaming, effectively implementing its functionality.
- Developers should not modify this variable directly, but instead use the au.editor.ForceAudioNonStreaming console command or project settings.
- Best practice is to treat this as an internal implementation detail and interact with the feature through the exposed au.editor.ForceAudioNonStreaming setting.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWave.cpp:48
Scope: file
Source code excerpt:
static int32 ForceNonStreamingInEditorCVar = 0;
FAutoConsoleVariableRef CVarForceNonStreamingInEditor(
TEXT("au.editor.ForceAudioNonStreaming"),
ForceNonStreamingInEditorCVar,
TEXT("When set to 1, forces any audio played to be non-streaming May force a DDC miss.\n")
TEXT("0: Honor the Play When Silent flag, 1: stop all silent non-procedural sources."),
ECVF_Default);
static int32 DisableRetainingCVar = 0;
#Associated Variable and Callsites
This variable is associated with another variable named ForceNonStreamingInEditorCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWave.cpp:46
Scope: file
Source code excerpt:
ECVF_Default);
static int32 ForceNonStreamingInEditorCVar = 0;
FAutoConsoleVariableRef CVarForceNonStreamingInEditor(
TEXT("au.editor.ForceAudioNonStreaming"),
ForceNonStreamingInEditorCVar,
TEXT("When set to 1, forces any audio played to be non-streaming May force a DDC miss.\n")
TEXT("0: Honor the Play When Silent flag, 1: stop all silent non-procedural sources."),
ECVF_Default);
static int32 DisableRetainingCVar = 0;
FAutoConsoleVariableRef CVarDisableRetaining(
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWave.cpp:3598
Scope (from outer to inner):
file
function bool USoundWave::IsStreaming
Source code excerpt:
{
const bool bIsForceInline = LoadingBehavior == ESoundWaveLoadingBehavior::ForceInline;
const bool bIsForcedNonStreamingInEditor = (GIsEditor && ForceNonStreamingInEditorCVar != 0);
const bool bIsForcedNonStreaming = (bProcedural || bIsForceInline || bIsForcedNonStreamingInEditor);
if (bIsForcedNonStreaming)
{
SoundWaveDataPtr->bIsStreaming = false;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SoundWave.cpp:3619
Scope (from outer to inner):
file
function bool USoundWave::IsStreaming
Source code excerpt:
// our cook overrides, or the AutoStreamingThreshold was set and this sound is longer than the auto streaming threshold.
const bool bIsForceInline = LoadingBehavior == ESoundWaveLoadingBehavior::ForceInline;
const bool bIsForcedNonStreamingInEditor = (GIsEditor && ForceNonStreamingInEditorCVar != 0);
const bool bIsForcedNonStreaming = (bProcedural || bIsForceInline || bIsForcedNonStreamingInEditor);
if (bIsForcedNonStreaming)
{
SoundWaveDataPtr->bIsStreaming = false;