au.RecoverRecordingOnShutdown
au.RecoverRecordingOnShutdown
#Overview
name: au.RecoverRecordingOnShutdown
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When set to 1, we will attempt to bounce the recording to a wav file if the game is shutdown while a recording is in flight.\n0: Disabled, 1: Enabled
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.RecoverRecordingOnShutdown is to control the behavior of the audio recording system when the game is shut down unexpectedly while an audio recording is in progress.
This setting variable is primarily used by the Audio Mixer subsystem in Unreal Engine 5. It is specifically referenced in the AudioMixerSubmix module, which is responsible for managing audio submixes and their associated effects.
The value of this variable is set through the Unreal Engine console variable system. It is initialized to 0 (disabled) by default, but can be changed at runtime using console commands or through configuration files.
The au.RecoverRecordingOnShutdown variable interacts directly with the RecoverRecordingOnShutdownCVar variable. They share the same value, with RecoverRecordingOnShutdownCVar being the actual integer storage for the console variable.
Developers must be aware that when this variable is enabled (set to 1), the engine will attempt to save any in-progress audio recordings to a WAV file if the game is shut down unexpectedly. This can be useful for preserving work or debugging audio issues, but may also have performance implications during shutdown.
Best practices when using this variable include:
- Enable it during development and testing phases to capture unexpected audio recording interruptions.
- Disable it in release builds unless there’s a specific need for this functionality.
- Be aware of the potential performance impact during shutdown when enabled.
- Monitor the output logs for any warnings related to interrupted recordings.
Regarding the associated variable RecoverRecordingOnShutdownCVar:
The purpose of RecoverRecordingOnShutdownCVar is to serve as the actual storage for the au.RecoverRecordingOnShutdown console variable value.
This variable is used internally by the Audio Mixer subsystem to determine whether to attempt recovery of interrupted recordings.
The value of RecoverRecordingOnShutdownCVar is set automatically by the FAutoConsoleVariableRef system when au.RecoverRecordingOnShutdown is modified.
RecoverRecordingOnShutdownCVar interacts directly with the au.RecoverRecordingOnShutdown console variable and is used in the FMixerSubmix destructor to determine whether to attempt saving an interrupted recording.
Developers should not modify RecoverRecordingOnShutdownCVar directly, but instead use the au.RecoverRecordingOnShutdown console variable to control this functionality.
Best practices for RecoverRecordingOnShutdownCVar include:
- Treat it as a read-only variable in your code.
- Use it for conditional logic related to recording recovery, as demonstrated in the FMixerSubmix destructor.
- Remember that its value reflects the state of au.RecoverRecordingOnShutdown.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:24
Scope: file
Source code excerpt:
static int32 RecoverRecordingOnShutdownCVar = 0;
FAutoConsoleVariableRef CVarRecoverRecordingOnShutdown(
TEXT("au.RecoverRecordingOnShutdown"),
RecoverRecordingOnShutdownCVar,
TEXT("When set to 1, we will attempt to bounce the recording to a wav file if the game is shutdown while a recording is in flight.\n")
TEXT("0: Disabled, 1: Enabled"),
ECVF_Default);
static int32 BypassAllSubmixEffectsCVar = 0;
#Associated Variable and Callsites
This variable is associated with another variable named RecoverRecordingOnShutdownCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:22
Scope: file
Source code excerpt:
CSV_DECLARE_CATEGORY_MODULE_EXTERN(AUDIOMIXERCORE_API, Audio);
static int32 RecoverRecordingOnShutdownCVar = 0;
FAutoConsoleVariableRef CVarRecoverRecordingOnShutdown(
TEXT("au.RecoverRecordingOnShutdown"),
RecoverRecordingOnShutdownCVar,
TEXT("When set to 1, we will attempt to bounce the recording to a wav file if the game is shutdown while a recording is in flight.\n")
TEXT("0: Disabled, 1: Enabled"),
ECVF_Default);
static int32 BypassAllSubmixEffectsCVar = 0;
FAutoConsoleVariableRef CVarBypassAllSubmixEffects(
#Loc: <Workspace>/Engine/Source/Runtime/AudioMixer/Private/AudioMixerSubmix.cpp:205
Scope (from outer to inner):
file
namespace Audio
function FMixerSubmix::~FMixerSubmix
Source code excerpt:
ClearSoundEffectSubmixes();
if (RecoverRecordingOnShutdownCVar && OwningSubmixObject.IsValid() && bIsRecording)
{
FString InterruptedFileName = TEXT("InterruptedRecording.wav");
UE_LOG(LogAudioMixer, Warning, TEXT("Recording of Submix %s was interrupted. Saving interrupted recording as %s."), *(OwningSubmixObject->GetName()), *InterruptedFileName);
if (const USoundSubmix* SoundSubmix = Cast<const USoundSubmix>(OwningSubmixObject))
{
USoundSubmix* MutableSubmix = const_cast<USoundSubmix*>(SoundSubmix);