UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAudioChunkCache Class Reference

#include <AudioStreamingCache.h>

Classes

struct  FCacheMissEntry
 
struct  FChunkKey
 

Public Types

enum class  EDebugDisplayElementTypes {
  NumRetainedAndPlaying = 0 , NumRetained , NumPrimedAndPlaying , NumPrimed ,
  NumRetainedAndPlayingCacheMiss , NumRetainedCacheMiss , NumPrimedAndPlayingCacheMiss , NumPrimedCacheMiss ,
  NumLODAndPlaying , NumLOD , NumTrimmed , NumLoadInProgress ,
  NumOther , Count
}
 

Public Member Functions

 FAudioChunkCache (uint32 InMaxChunkSize, uint32 NumChunks, uint64 InMemoryLimitInBytes)
 
 ~FAudioChunkCache ()
 
uint64 AddOrTouchChunk (const FChunkKey &InKey, const TSharedPtr< FSoundWaveData > &InSoundWavePtr, TFunction< void(EAudioChunkLoadResult) > OnLoadCompleted, ENamedThreads::Type CallbackThread, bool bNeededForPlayback)
 
TArrayView< uint8GetChunk (const FChunkKey &InKey, const TSharedPtr< FSoundWaveData > &InSoundWavePtr, bool bBlockForLoadCompletion, bool bNeededForPlayback, uint64 &InOutCacheLookupID)
 
void AddNewReferenceToChunk (const FChunkKey &InKey)
 
void RemoveReferenceToChunk (const FChunkKey &InKey)
 
void ClearCache ()
 
void AddForceInlineSoundWave (const FSoundWaveProxyPtr &)
 
void RemoveForceInlineSoundWave (const FSoundWaveProxyPtr &)
 
void AddMemoryCountedFeature (const FAudioStreamCacheMemoryHandle &Feature)
 
void RemoveMemoryCountedFeature (const FAudioStreamCacheMemoryHandle &Feature)
 
uint64 TrimMemory (uint64 BytesToFree, bool bAllowRetainedChunkTrimming)
 
TArray< FObjectKeyGetLeastRecentlyUsedRetainedSoundWaves (int32 NumSoundWavesToRetrieve)
 
void BlockForAllPendingLoads () const
 
void CancelAllPendingLoads ()
 
uint64 ReportCacheSize ()
 
void BeginLoggingCacheMisses ()
 
void StopLoggingCacheMisses ()
 
FString FlushCacheMissLog ()
 
uint64 GetCacheLookupIDForChunk (const FChunkKey &InChunkKey) const
 
void SetCacheLookupIDForChunk (const FChunkKey &InChunkKey, uint64 InCacheLookupID)
 
TPair< int, int > DebugDisplayLegacy (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation) const
 
FString DebugPrint ()
 
TPair< int, int > DebugDisplay (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation) const
 
TPair< int, int > DebugVisualDisplay (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation) const
 
TPair< int, int > DebugBirdsEyeDisplay (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation) const
 
void HandleStarvation (const FSoundWaveProxyPtr &SoundWave, const uint32 ChunkIndex, const uint32 InBytesProduced, const uint32 InBytesExpected)
 
void IncrementCacheOverflowCounter ()
 
int32 GetNumberOfCacheOverflows () const
 

Static Public Member Functions

static bool DoesKeyContainValidChunkIndex (const FChunkKey &InKey, const FSoundWaveData &InSoundWaveData)
 

Public Attributes

const int32 MaxChunkSize
 

Member Enumeration Documentation

◆ EDebugDisplayElementTypes

Enumerator
NumRetainedAndPlaying 
NumRetained 
NumPrimedAndPlaying 
NumPrimed 
NumRetainedAndPlayingCacheMiss 
NumRetainedCacheMiss 
NumPrimedAndPlayingCacheMiss 
NumPrimedCacheMiss 
NumLODAndPlaying 
NumLOD 
NumTrimmed 
NumLoadInProgress 
NumOther 
Count 

Constructor & Destructor Documentation

◆ FAudioChunkCache()

FAudioChunkCache::FAudioChunkCache ( uint32  InMaxChunkSize,
uint32  NumChunks,
uint64  InMemoryLimitInBytes 
)

◆ ~FAudioChunkCache()

FAudioChunkCache::~FAudioChunkCache ( )

Member Function Documentation

◆ AddForceInlineSoundWave()

void FAudioChunkCache::AddForceInlineSoundWave ( const FSoundWaveProxyPtr SoundWave)

◆ AddMemoryCountedFeature()

void FAudioChunkCache::AddMemoryCountedFeature ( const FAudioStreamCacheMemoryHandle Feature)

◆ AddNewReferenceToChunk()

void FAudioChunkCache::AddNewReferenceToChunk ( const FChunkKey InKey)

◆ AddOrTouchChunk()

uint64 FAudioChunkCache::AddOrTouchChunk ( const FChunkKey InKey,
const TSharedPtr< FSoundWaveData > &  InSoundWavePtr,
TFunction< void(EAudioChunkLoadResult) >  OnLoadCompleted,
ENamedThreads::Type  CallbackThread,
bool  bNeededForPlayback 
)

◆ BeginLoggingCacheMisses()

void FAudioChunkCache::BeginLoggingCacheMisses ( )

◆ BlockForAllPendingLoads()

void FAudioChunkCache::BlockForAllPendingLoads ( ) const

◆ CancelAllPendingLoads()

void FAudioChunkCache::CancelAllPendingLoads ( )

◆ ClearCache()

void FAudioChunkCache::ClearCache ( )

◆ DebugBirdsEyeDisplay()

TPair< int, int > FAudioChunkCache::DebugBirdsEyeDisplay ( UWorld World,
FViewport Viewport,
FCanvas Canvas,
int32  X,
int32  Y,
const FVector ViewLocation,
const FRotator ViewRotation 
) const

◆ DebugDisplay()

TPair< int, int > FAudioChunkCache::DebugDisplay ( UWorld World,
FViewport Viewport,
FCanvas Canvas,
int32  X,
int32  Y,
const FVector ViewLocation,
const FRotator ViewRotation 
) const

◆ DebugDisplayLegacy()

TPair< int, int > FAudioChunkCache::DebugDisplayLegacy ( UWorld World,
FViewport Viewport,
FCanvas Canvas,
int32  X,
int32  Y,
const FVector ViewLocation,
const FRotator ViewRotation 
) const

◆ DebugPrint()

FString FAudioChunkCache::DebugPrint ( )

◆ DebugVisualDisplay()

TPair< int, int > FAudioChunkCache::DebugVisualDisplay ( UWorld World,
FViewport Viewport,
FCanvas Canvas,
int32  X,
int32  Y,
const FVector ViewLocation,
const FRotator ViewRotation 
) const

◆ DoesKeyContainValidChunkIndex()

bool FAudioChunkCache::DoesKeyContainValidChunkIndex ( const FChunkKey InKey,
const FSoundWaveData InSoundWaveData 
)
static

◆ FlushCacheMissLog()

FString FAudioChunkCache::FlushCacheMissLog ( )

◆ GetCacheLookupIDForChunk()

uint64 FAudioChunkCache::GetCacheLookupIDForChunk ( const FChunkKey InChunkKey) const

◆ GetChunk()

TArrayView< uint8 > FAudioChunkCache::GetChunk ( const FChunkKey InKey,
const TSharedPtr< FSoundWaveData > &  InSoundWavePtr,
bool  bBlockForLoadCompletion,
bool  bNeededForPlayback,
uint64 InOutCacheLookupID 
)

◆ GetLeastRecentlyUsedRetainedSoundWaves()

TArray< FObjectKey > FAudioChunkCache::GetLeastRecentlyUsedRetainedSoundWaves ( int32  NumSoundWavesToRetrieve)

◆ GetNumberOfCacheOverflows()

int32 FAudioChunkCache::GetNumberOfCacheOverflows ( ) const
inline

◆ HandleStarvation()

void FAudioChunkCache::HandleStarvation ( const FSoundWaveProxyPtr SoundWave,
const uint32  ChunkIndex,
const uint32  InBytesProduced,
const uint32  InBytesExpected 
)

◆ IncrementCacheOverflowCounter()

void FAudioChunkCache::IncrementCacheOverflowCounter ( )
inline

◆ RemoveForceInlineSoundWave()

void FAudioChunkCache::RemoveForceInlineSoundWave ( const FSoundWaveProxyPtr SoundWave)

◆ RemoveMemoryCountedFeature()

void FAudioChunkCache::RemoveMemoryCountedFeature ( const FAudioStreamCacheMemoryHandle Feature)

◆ RemoveReferenceToChunk()

void FAudioChunkCache::RemoveReferenceToChunk ( const FChunkKey InKey)

◆ ReportCacheSize()

uint64 FAudioChunkCache::ReportCacheSize ( )

◆ SetCacheLookupIDForChunk()

void FAudioChunkCache::SetCacheLookupIDForChunk ( const FChunkKey InChunkKey,
uint64  InCacheLookupID 
)

◆ StopLoggingCacheMisses()

void FAudioChunkCache::StopLoggingCacheMisses ( )

◆ TrimMemory()

uint64 FAudioChunkCache::TrimMemory ( uint64  BytesToFree,
bool  bAllowRetainedChunkTrimming 
)

Member Data Documentation

◆ MaxChunkSize

const int32 FAudioChunkCache::MaxChunkSize

The documentation for this class was generated from the following files: