![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "AudioStreamingCache.h"#include "AudioStreamCacheMemoryHandle.h"#include "Async/Async.h"#include "Audio.h"#include "Audio/AudioDebug.h"#include "Audio/AudioTimingLog.h"#include "AudioCompressionSettingsUtils.h"#include "CanvasTypes.h"#include "Engine/Engine.h"#include "Stats/StatsTrace.h"#include "ProfilingDebugging/IoStoreTrace.h"#include "ProfilingDebugging/CountersTrace.h"#include "Audio/AudioDebugDraw.h"#include "IO/IoBuffer.h"#include "Templates/Greater.h"#include "Engine/Font.h"Classes | |
| class | FClearAudioChunkCacheReadRequestTask |
Macros | |
| #define | CASE_TO_STRING(X) case X: return TEXT(#X) |
Enumerations | |
| enum | CacheDisplaySortMethod { CDSM_RecentlyUsed , CDSM_LoadTime , CDSM_AccessCount , CDSM_RetainingHandleCount , CDSM_LoadStartTime } |
Functions | |
| DEFINE_LOG_CATEGORY (LogAudioStreamCaching) | |
| TRACE_DECLARE_ATOMIC_INT_COUNTER (AudioStreamCache_Loads, TEXT("AudioStreamCache Loads")) | |
| TRACE_DECLARE_ATOMIC_INT_COUNTER (AudioStreamCache_Loads_Request, TEXT("AudioStreamCache Loads Request")) | |
| TRACE_DECLARE_ATOMIC_INT_COUNTER (AudioStreamCache_Loads_Playback, TEXT("AudioStreamCache Loads Playback")) | |
Variables | |
| FAutoConsoleVariableRef | CVarDebugDisplayCaches (TEXT("au.streamcaching.MaxCachesToDisplay"), DebugMaxElementsDisplayCVar, TEXT("n: Number of elements to display on screen."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarDebugCacheDisplaySortMethod (TEXT("au.streamcaching.CacheDisplaySortMethod"), DebugCacheDisplaySortMethod, TEXT(" 4 : When Loaded.\n"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarKeepCacheMissBufferOnFlush (TEXT("au.streamcaching.KeepCacheMissBufferOnFlush"), KeepCacheMissBufferOnFlushCVar, TEXT("1: All cache misses from the whole session will show up in audiomemreport. 0: Only cache misses since the previous call to audiomemreport will show up in the current audiomemreport."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarForceBlockForLoad (TEXT("au.streamcaching.ForceBlockForLoad"), ForceBlockForLoadCVar, TEXT("When set to a nonzero value, blocks GetLoadedChunk until the disk read is complete.\n"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarTrimCacheWhenOverBudget (TEXT("au.streamcaching.TrimCacheWhenOverBudget"), TrimCacheWhenOverBudgetCVar, TEXT("When set to a nonzero value, TrimMemory will be called in AddOrTouchChunk to ensure we never go over budget.\n"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarAlwaysLogCacheMisses (TEXT("au.streamcaching.AlwaysLogCacheMisses"), AlwaysLogCacheMissesCVar, TEXT("0: Don't log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarReadRequestPriority (TEXT("au.streamcaching.ReadRequestPriority"), ReadRequestPriorityCVar, TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarPlaybackRequestPriority (TEXT("au.streamcaching.PlaybackRequestPriority"), PlaybackRequestPriorityCVar, TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarBlockForPendingLoadOnCacheOverflow (TEXT("au.streamcaching.BlockForPendingLoadOnCacheOverflow"), BlockForPendingLoadOnCacheOverflowCVar, TEXT("0: When we blow the cache we clear any soundwave retainers. 1:When we blow the cache we attempt to cancel a load in flight."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarNumSoundWavesToClearOnCacheOverflow (TEXT("au.streamcaching.NumSoundWavesToClearOnCacheOverflow"), NumSoundWavesToClearOnCacheOverflowCVar, TEXT("0: reset all retained sounds on cache overflow, >0: evict this many sounds on any cache overflow."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarEnableTrimmingRetainedAudio (TEXT("au.streamcaching.EnableTrimmingRetainedAudio"), EnableTrimmingRetainedAudioCVar, TEXT("0: never trims retained audio, >0: will trim retained audio."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarMemoryLimitTrimPercentage (TEXT("au.streamcaching.MemoryLimitTrimPercentage"), MemoryLimitTrimPercentageCVar, TEXT("0.0: trims only the amount needed to allocate a single chunk, >0: that percentage of memory limit."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarStreamCacheSizeOverrideMB (TEXT("au.streamcaching.StreamCacheSizeOverrideMB"), StreamCacheSizeOverrideMBCVar, TEXT("0: use cache size from project settings. n: the new cache size in megabytes."), ECVF_Default) |
| FAutoConsoleVariableRef | CVarSaveAudiomemReportOnCacheOverflow (TEXT("au.streamcaching.SaveAudiomemReportOnCacheOverflow"), SaveAudioMemReportOnCacheOverflowCVar, TEXT("0: Disabled, 1: Enabled"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarDebugView (TEXT("au.streamcaching.DebugView"), DebugViewCVar, TEXT("0: Legacy, 1: Default, 2: Averaged View, 3: High Detail View"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarSearchUsingChunkArray (TEXT("au.streamcaching.SearchUsingChunkArray"), SearchUsingChunkArrayCVar, TEXT("0: Search using LRU (linked list). 1: Search using Chunk Pool (TArray)"), ECVF_Default) |
| FAutoConsoleVariableRef | CVarEnableExhaustiveCacheSearches (TEXT("au.streamcaching.EnableExhaustiveCacheSearches"), EnableExhaustiveCacheSearchesCVar, TEXT("0: Rely on chunk offset. 1: Search using linear search"), ECVF_Default) |
| DEFINE_LOG_CATEGORY | ( | LogAudioStreamCaching | ) |
| TRACE_DECLARE_ATOMIC_INT_COUNTER | ( | AudioStreamCache_Loads | , |
| TEXT("AudioStreamCache Loads") | |||
| ) |
| TRACE_DECLARE_ATOMIC_INT_COUNTER | ( | AudioStreamCache_Loads_Playback | , |
| TEXT("AudioStreamCache Loads Playback") | |||
| ) |
| TRACE_DECLARE_ATOMIC_INT_COUNTER | ( | AudioStreamCache_Loads_Request | , |
| TEXT("AudioStreamCache Loads Request") | |||
| ) |
| FAutoConsoleVariableRef CVarAlwaysLogCacheMisses(TEXT("au.streamcaching.AlwaysLogCacheMisses"), AlwaysLogCacheMissesCVar, TEXT("0: Don't log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses."), ECVF_Default) | ( | TEXT("au.streamcaching.AlwaysLogCacheMisses") | , |
| AlwaysLogCacheMissesCVar | , | ||
| TEXT("0: Don't log cache misses until au.streamcaching.StartProfiling is called. 1: Always log cache misses.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarBlockForPendingLoadOnCacheOverflow(TEXT("au.streamcaching.BlockForPendingLoadOnCacheOverflow"), BlockForPendingLoadOnCacheOverflowCVar, TEXT("0: When we blow the cache we clear any soundwave retainers. 1:When we blow the cache we attempt to cancel a load in flight."), ECVF_Default) | ( | TEXT("au.streamcaching.BlockForPendingLoadOnCacheOverflow") | , |
| BlockForPendingLoadOnCacheOverflowCVar | , | ||
| TEXT("0: When we blow the cache we clear any soundwave retainers. 1:When we blow the cache we attempt to cancel a load in flight.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarDebugCacheDisplaySortMethod(TEXT("au.streamcaching.CacheDisplaySortMethod"), DebugCacheDisplaySortMethod, TEXT(" 4 : When Loaded.\n"), ECVF_Default) | ( | TEXT("au.streamcaching.CacheDisplaySortMethod") | , |
| DebugCacheDisplaySortMethod | , | ||
| TEXT(" 4 : When Loaded.\n") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarDebugDisplayCaches(TEXT("au.streamcaching.MaxCachesToDisplay"), DebugMaxElementsDisplayCVar, TEXT("n: Number of elements to display on screen."), ECVF_Default) | ( | TEXT("au.streamcaching.MaxCachesToDisplay") | , |
| DebugMaxElementsDisplayCVar | , | ||
| TEXT("n: Number of elements to display on screen.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarDebugView(TEXT("au.streamcaching.DebugView"), DebugViewCVar, TEXT("0: Legacy, 1: Default, 2: Averaged View, 3: High Detail View"), ECVF_Default) | ( | TEXT("au.streamcaching.DebugView") | , |
| DebugViewCVar | , | ||
| TEXT("0: Legacy, 1: Default, 2: Averaged View, 3: High Detail View") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarEnableExhaustiveCacheSearches(TEXT("au.streamcaching.EnableExhaustiveCacheSearches"), EnableExhaustiveCacheSearchesCVar, TEXT("0: Rely on chunk offset. 1: Search using linear search"), ECVF_Default) | ( | TEXT("au.streamcaching.EnableExhaustiveCacheSearches") | , |
| EnableExhaustiveCacheSearchesCVar | , | ||
| TEXT("0: Rely on chunk offset. 1: Search using linear search") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarEnableTrimmingRetainedAudio(TEXT("au.streamcaching.EnableTrimmingRetainedAudio"), EnableTrimmingRetainedAudioCVar, TEXT("0: never trims retained audio, >0: will trim retained audio."), ECVF_Default) | ( | TEXT("au.streamcaching.EnableTrimmingRetainedAudio") | , |
| EnableTrimmingRetainedAudioCVar | , | ||
| TEXT("0: never trims retained audio, >0: will trim retained audio.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarForceBlockForLoad(TEXT("au.streamcaching.ForceBlockForLoad"), ForceBlockForLoadCVar, TEXT("When set to a nonzero value, blocks GetLoadedChunk until the disk read is complete.\n"), ECVF_Default) | ( | TEXT("au.streamcaching.ForceBlockForLoad") | , |
| ForceBlockForLoadCVar | , | ||
| TEXT("When set to a nonzero value, blocks GetLoadedChunk until the disk read is complete.\n") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarKeepCacheMissBufferOnFlush(TEXT("au.streamcaching.KeepCacheMissBufferOnFlush"), KeepCacheMissBufferOnFlushCVar, TEXT("1: All cache misses from the whole session will show up in audiomemreport. 0: Only cache misses since the previous call to audiomemreport will show up in the current audiomemreport."), ECVF_Default) | ( | TEXT("au.streamcaching.KeepCacheMissBufferOnFlush") | , |
| KeepCacheMissBufferOnFlushCVar | , | ||
| TEXT("1: All cache misses from the whole session will show up in audiomemreport. 0: Only cache misses since the previous call to audiomemreport will show up in the current audiomemreport.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarMemoryLimitTrimPercentage(TEXT("au.streamcaching.MemoryLimitTrimPercentage"), MemoryLimitTrimPercentageCVar, TEXT("0.0: trims only the amount needed to allocate a single chunk, >0: that percentage of memory limit."), ECVF_Default) | ( | TEXT("au.streamcaching.MemoryLimitTrimPercentage") | , |
| MemoryLimitTrimPercentageCVar | , | ||
| TEXT("0.0: trims only the amount needed to allocate a single chunk, >0: that percentage of memory limit.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarNumSoundWavesToClearOnCacheOverflow(TEXT("au.streamcaching.NumSoundWavesToClearOnCacheOverflow"), NumSoundWavesToClearOnCacheOverflowCVar, TEXT("0: reset all retained sounds on cache overflow, >0: evict this many sounds on any cache overflow."), ECVF_Default) | ( | TEXT("au.streamcaching.NumSoundWavesToClearOnCacheOverflow") | , |
| NumSoundWavesToClearOnCacheOverflowCVar | , | ||
| TEXT("0: reset all retained sounds on cache overflow, >0: evict this many sounds on any cache overflow.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarPlaybackRequestPriority(TEXT("au.streamcaching.PlaybackRequestPriority"), PlaybackRequestPriorityCVar, TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"), ECVF_Default) | ( | TEXT("au.streamcaching.PlaybackRequestPriority") | , |
| PlaybackRequestPriorityCVar | , | ||
| TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarReadRequestPriority(TEXT("au.streamcaching.ReadRequestPriority"), ReadRequestPriorityCVar, TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min"), ECVF_Default) | ( | TEXT("au.streamcaching.ReadRequestPriority") | , |
| ReadRequestPriorityCVar | , | ||
| TEXT("0: High, 1: Normal, 2: Below Normal, 3: Low, 4: Min") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarSaveAudiomemReportOnCacheOverflow(TEXT("au.streamcaching.SaveAudiomemReportOnCacheOverflow"), SaveAudioMemReportOnCacheOverflowCVar, TEXT("0: Disabled, 1: Enabled"), ECVF_Default) | ( | TEXT("au.streamcaching.SaveAudiomemReportOnCacheOverflow") | , |
| SaveAudioMemReportOnCacheOverflowCVar | , | ||
| TEXT("0: Disabled, 1: Enabled") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarSearchUsingChunkArray(TEXT("au.streamcaching.SearchUsingChunkArray"), SearchUsingChunkArrayCVar, TEXT("0: Search using LRU (linked list). 1: Search using Chunk Pool (TArray)"), ECVF_Default) | ( | TEXT("au.streamcaching.SearchUsingChunkArray") | , |
| SearchUsingChunkArrayCVar | , | ||
| TEXT("0: Search using LRU (linked list). 1: Search using Chunk Pool (TArray)") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarStreamCacheSizeOverrideMB(TEXT("au.streamcaching.StreamCacheSizeOverrideMB"), StreamCacheSizeOverrideMBCVar, TEXT("0: use cache size from project settings. n: the new cache size in megabytes."), ECVF_Default) | ( | TEXT("au.streamcaching.StreamCacheSizeOverrideMB") | , |
| StreamCacheSizeOverrideMBCVar | , | ||
| TEXT("0: use cache size from project settings. n: the new cache size in megabytes.") | , | ||
| ECVF_Default | |||
| ) |
| FAutoConsoleVariableRef CVarTrimCacheWhenOverBudget(TEXT("au.streamcaching.TrimCacheWhenOverBudget"), TrimCacheWhenOverBudgetCVar, TEXT("When set to a nonzero value, TrimMemory will be called in AddOrTouchChunk to ensure we never go over budget.\n"), ECVF_Default) | ( | TEXT("au.streamcaching.TrimCacheWhenOverBudget") | , |
| TrimCacheWhenOverBudgetCVar | , | ||
| TEXT("When set to a nonzero value, TrimMemory will be called in AddOrTouchChunk to ensure we never go over budget.\n") | , | ||
| ECVF_Default | |||
| ) |