UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IAudioStreamingManager Struct Referenceabstract

#include <ContentStreaming.h>

+ Inheritance diagram for IAudioStreamingManager:

Public Member Functions

virtual void AddForceInlineSoundWave (const FSoundWaveProxyPtr &SoundWave)
 
virtual void RemoveForceInlineSoundWave (const FSoundWaveProxyPtr &SoundWave)
 
virtual bool RequestChunk (const FSoundWaveProxyPtr &SoundWave, uint32 ChunkIndex, TFunction< void(EAudioChunkLoadResult)> OnLoadCompleted=LoadCompletedDefault, ENamedThreads::Type ThreadToCallOnLoadCompletedOn=ENamedThreads::AnyThread, bool bForImmediatePlayback=false)=0
 
virtual FAudioChunkHandle GetLoadedChunk (const FSoundWaveProxyPtr &SoundWave, uint32 ChunkIndex, bool bBlockForLoad=false, bool bForImmediatePlayback=false) const =0
 
virtual uint64 TrimMemory (uint64 NumBytesToFree)=0
 
virtual int32 RenderStatAudioStreaming (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation)=0
 
virtual FString GenerateMemoryReport ()=0
 
virtual void SetProfilingMode (bool bEnabled)=0
 
virtual void HandleStarvation (const FSoundWaveProxyPtr &SoundWave, const uint32 ChunkIndex, const uint32 InBytesProduced, const uint32 InBytesExpected)
 
- Public Member Functions inherited from IStreamingManager
 IStreamingManager ()
 
virtual ~IStreamingManager ()
 
virtual ENGINE_API void Tick (float DeltaTime, bool bProcessEverything=false)
 
virtual void UpdateResourceStreaming (float DeltaTime, bool bProcessEverything=false)=0
 
virtual ENGINE_API int32 StreamAllResources (float TimeLimit=0.0f)
 
virtual int32 BlockTillAllRequestsFinished (float TimeLimit=0.0f, bool bLogResults=false)=0
 
virtual void CancelForcedResources ()=0
 
virtual void NotifyLevelChange ()=0
 
void RemoveStreamingViews (ERemoveStreamingViews RemovalType)
 
ENGINE_API void AddViewInformation (const FVector &ViewOrigin, float ScreenSize, float FOVScreenSize, float BoostFactor=1.0f, bool bOverrideLocation=false, float Duration=0.0f, TWeakObjectPtr< AActor > InActorToBoost=NULL, TWeakObjectPtr< UWorld > InWorld=NULL)
 
ENGINE_API void AddViewLocation (const FVector &Location, float BoostFactor=1.0f, bool bOverrideLocation=false, float Duration=0.0f)
 
virtual void SetDisregardWorldResourcesForFrames (int32 NumFrames)=0
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 
virtual void AddLevel (class ULevel *Level)=0
 
virtual void RemoveLevel (class ULevel *Level)=0
 
virtual void NotifyLevelOffset (class ULevel *Level, const FVector &Offset)=0
 
virtual void NotifyActorDestroyed (AActor *Actor)
 
virtual void NotifyPrimitiveDetached (const UPrimitiveComponent *Primitive)
 
virtual void NotifyPrimitiveUpdated (const UPrimitiveComponent *Primitive)
 
virtual void NotifyPrimitiveUpdated_Concurrent (const UPrimitiveComponent *Primitive)
 
int32 GetNumViews () const
 
const FStreamingViewInfoGetViewInformation (int32 ViewIndex) const
 
virtual int32 GetNumWantingResources () const
 
virtual int32 GetNumWantingResourcesID () const
 
virtual void PropagateLightingScenarioChange ()
 

Static Public Attributes

static constexpr auto LoadCompletedDefault = [](EAudioChunkLoadResult) {}
 

Protected Member Functions

virtual void AddReferenceToChunk (const FAudioChunkHandle &InHandle)=0
 
virtual void RemoveReferenceToChunk (const FAudioChunkHandle &InHandle)=0
 
virtual void AddMemoryCountedFeature (const FAudioStreamCacheMemoryHandle &Feature)
 
virtual void RemoveMemoryCountedFeature (const FAudioStreamCacheMemoryHandle &Feature)
 
- Protected Member Functions inherited from IStreamingManager
void SetupViewInfos (float DeltaTime)
 

Static Protected Member Functions

static FAudioChunkHandle BuildChunkHandle (const uint8 *InData, uint32 NumBytes, const FSoundWaveProxyPtr &InSoundWave, const FName &SoundWaveName, uint32 InChunkIndex, uint64 CacheLookupID)
 
- Static Protected Member Functions inherited from IStreamingManager
static void AddViewInfoToArray (TArray< FStreamingViewInfo > &ViewInfos, const FVector &ViewOrigin, float ScreenSize, float FOVScreenSize, float BoostFactor, bool bOverrideLocation, float Duration, TWeakObjectPtr< AActor > InActorToBoost, TWeakObjectPtr< UWorld > InWorld)
 
static void RemoveViewInfoFromArray (TArray< FStreamingViewInfo > &ViewInfos, const FVector &ViewOrigin)
 

Protected Attributes

friend FAudioChunkHandle
 
friend FAudioStreamCacheMemoryHandle
 
- Protected Attributes inherited from IStreamingManager
int32 NumWantingResources
 
int32 NumWantingResourcesCounter
 

Additional Inherited Members

- Static Public Member Functions inherited from IStreamingManager
static ENGINE_API struct FStreamingManagerCollectionGet ()
 
static ENGINE_API struct FStreamingManagerCollectionGet_Concurrent ()
 
static ENGINE_API void Shutdown ()
 
static ENGINE_API bool HasShutdown ()
 
- Static Protected Attributes inherited from IStreamingManager
static ENGINE_API TArray< FStreamingViewInfoCurrentViewInfos
 
static TArray< FStreamingViewInfoPendingViewInfos
 
static TArray< FStreamingViewInfoLastingViewInfos
 
static TArray< FSecondaryLocationSecondaryLocations
 
static bool bPendingRemoveViews = false
 

Detailed Description

Interface to add functions specifically related to audio streaming

Member Function Documentation

◆ AddForceInlineSoundWave()

virtual void IAudioStreamingManager::AddForceInlineSoundWave ( const FSoundWaveProxyPtr SoundWave)
inlinevirtual

Adds the memory usage of the force inline sound to the streaming cache budget

Reimplemented in FCachedAudioStreamingManager.

◆ AddMemoryCountedFeature()

virtual void IAudioStreamingManager::AddMemoryCountedFeature ( const FAudioStreamCacheMemoryHandle Feature)
inlineprotectedvirtual

This can be used to increase the memory count for external features. Called by FAudioStreamCacheMemoryHandle. The pattern for changing the amount of memory of an already added feature is to first remove and then add again with the new number

Reimplemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ AddReferenceToChunk()

virtual void IAudioStreamingManager::AddReferenceToChunk ( const FAudioChunkHandle InHandle)
protectedpure virtual

This can be used to increment reference counted handles to audio chunks. Called by the copy constructor of FAudioChunkHandle.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ BuildChunkHandle()

FAudioChunkHandle IAudioStreamingManager::BuildChunkHandle ( const uint8 InData,
uint32  NumBytes,
const FSoundWaveProxyPtr InSoundWave,
const FName SoundWaveName,
uint32  InChunkIndex,
uint64  CacheLookupID 
)
staticprotected

This can be called by implementers of IAudioStreamingManager to construct an FAudioChunkHandle using an otherwise inaccessible constructor.

◆ GenerateMemoryReport()

virtual FString IAudioStreamingManager::GenerateMemoryReport ( )
pure virtual

Generate a memory report as a formatted string for this streaming manager.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ GetLoadedChunk()

virtual FAudioChunkHandle IAudioStreamingManager::GetLoadedChunk ( const FSoundWaveProxyPtr SoundWave,
uint32  ChunkIndex,
bool  bBlockForLoad = false,
bool  bForImmediatePlayback = false 
) const
pure virtual

Gets a pointer to a chunk of audio data

Parameters
SoundWaveSoundWave we want a chunk from
ChunkIndexIndex of the chunk we want
bBlockForLoadif true, will block this thread until we finish loading this chunk.
bForImmediatePlaybackif true, will optionally reprioritize this chunk's load request. See au.streamcaching.PlaybackRequestPriority.
Returns
a handle to the loaded chunk. Can return a default constructed FAudioChunkHandle if the chunk is not loaded yet.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ HandleStarvation()

virtual void IAudioStreamingManager::HandleStarvation ( const FSoundWaveProxyPtr SoundWave,
const uint32  ChunkIndex,
const uint32  InBytesProduced,
const uint32  InBytesExpected 
)
inlinevirtual

In the event that the decoder playing back the chunks is in a starvation state due to an outstanding chunk load, handle that here.

Reimplemented in FCachedAudioStreamingManager.

◆ RemoveForceInlineSoundWave()

virtual void IAudioStreamingManager::RemoveForceInlineSoundWave ( const FSoundWaveProxyPtr SoundWave)
inlinevirtual

Removes the memory usage of the force inline sound from the streaming cache budget

Reimplemented in FCachedAudioStreamingManager.

◆ RemoveMemoryCountedFeature()

virtual void IAudioStreamingManager::RemoveMemoryCountedFeature ( const FAudioStreamCacheMemoryHandle Feature)
inlineprotectedvirtual

This can be used to decrease the memory count for external features. Called by FAudioStreamCacheMemoryHandle.

Reimplemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ RemoveReferenceToChunk()

virtual void IAudioStreamingManager::RemoveReferenceToChunk ( const FAudioChunkHandle InHandle)
protectedpure virtual

This can be used to decrement reference counted handles to audio chunks. Called by the destructor of FAudioChunkHandle.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ RenderStatAudioStreaming()

virtual int32 IAudioStreamingManager::RenderStatAudioStreaming ( UWorld World,
FViewport Viewport,
FCanvas Canvas,
int32  X,
int32  Y,
const FVector ViewLocation,
const FRotator ViewRotation 
)
pure virtual

Used for rendering debug info:

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ RequestChunk()

virtual bool IAudioStreamingManager::RequestChunk ( const FSoundWaveProxyPtr SoundWave,
uint32  ChunkIndex,
TFunction< void(EAudioChunkLoadResult)>  OnLoadCompleted = LoadCompletedDefault,
ENamedThreads::Type  ThreadToCallOnLoadCompletedOn = ENamedThreads::AnyThread,
bool  bForImmediatePlayback = false 
)
pure virtual

◆ SetProfilingMode()

virtual void IAudioStreamingManager::SetProfilingMode ( bool  bEnabled)
pure virtual

Whether to toggle a performance intensive profiling mode the streaming manager.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

◆ TrimMemory()

virtual uint64 IAudioStreamingManager::TrimMemory ( uint64  NumBytesToFree)
pure virtual

This will start evicting elements from the cache until either hit our target of bytes or run out of chunks we can free.

Parameters
NumBytesToFreeThe amount of memory we would like to free, in bytes.
Returns
the amount of bytes we managed to free.

Implemented in FCachedAudioStreamingManager, and FDummyAudioStreamingManager.

Member Data Documentation

◆ FAudioChunkHandle

friend IAudioStreamingManager::FAudioChunkHandle
protected

◆ FAudioStreamCacheMemoryHandle

friend IAudioStreamingManager::FAudioStreamCacheMemoryHandle
protected

◆ LoadCompletedDefault

constexpr auto IAudioStreamingManager::LoadCompletedDefault = [](EAudioChunkLoadResult) {}
staticconstexpr

Manually prepare a chunk to start playing back. This should only be used when the Load On Demand feature is enabled, and returns false on failure.

Parameters
SoundWaveSoundWave we would like to request a chunk of.
ChunkIndexthe index of that soundwave we'd like to request a chunk of.
OnLoadCompletedoptional callback when the load completes.
ThreadToCallOnLoadCompleteOn.Optional specifier for which thread OnLoadCompleted should be called on.
bForImmediatePlaybacif true, this will optionally reprioritize this chunk's load request.

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