FCachedAudioStreamingManager

This implementation of the audio streaming manager uses an internal LRU cache (or in more advanced applications, a bank of parallel LRU caches)

Windows
MacOS
Linux

Inheritance Hierarchy

IStreamingManager

IAudioStreamingManager

FCachedAudioStreamingManager

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/AudioStreamingCache.h

Include

#include "AudioStreamingCache.h"

Syntax

struct FCachedAudioStreamingManager : public IAudioStreamingManager

Remarks

This implementation of the audio streaming manager uses an internal LRU cache (or in more advanced applications, a bank of parallel LRU caches)

Variables

Name Description

Protected variable

TArray< FAudioC...

 

CacheArray

Audio chunk caches. These are set up on initialization.

Constructors

Name Description

Public function

FCachedAudioStreamingManager

(
    const FCachedAudioStreamingManagerP...
)

Constructor, initializing all members

Destructors

Functions

Name Description

Protected function Const

FAudioChunkC...

 

GetCacheForChunkSize

(
    uint32 InChunkSize
)

Protected function Const

FAudioChunkC...

 

GetCacheForWave

(
    const USoundWave* InSoundWave
)

Returns which cache this sound wave should be in, based on the size of this sound wave's chunk, or nullptr if MemoryLoadOnDemand is disabled.

Protected function Const

int32

 

GetNextChunkIndex

(
    const USoundWave* InSoundWave,
    uint32 CurrentChunkIndex
)

Returns the next chunk to kick off a load for, or INDEX_NONE if there is only one chunk to cache.

Overridden from IAudioStreamingManager

Name Description

Public function Virtual

void

 

AddDecoder

(
    ICompressedAudioInfo* Compress...
)

Adds the decoder to the streaming manager to prevent stream chunks from getting reaped from underneath it

Protected function Virtual

void

 

AddReferenceToChunk

(
    const FAudioChunkHandle& InHandle
)

These are used to reference count consumers of audio chunks.

Public function Virtual

void

 

AddStreamingSoundSource

(
    FSoundSource* SoundSource
)

Adds a new Sound Source to the streaming manager.

Public function Virtual

void

 

AddStreamingSoundWave

(
    USoundWave* SoundWave
)

IAudioStreamingManager interface (unused functions)

Public function Virtual Const

bool

 

CanCreateSoundSource

(
    const FWaveInstance* WaveInsta...
)

Public function Virtual

FString

 

GenerateMemoryReport()

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

Public function Virtual Const

FAudioChunkH...

 

GetLoadedChunk

(
    const USoundWave* SoundWave,
    uint32 ChunkIndex,
    bool bBlockForLoad,
    bool bForImmediatePlayback
)

Gets a pointer to a chunk of audio data

Public function Virtual Const

bool

 

IsManagedStreamingSoundSource

(
    const FSoundSource* SoundSourc...
)

Returns true if this is a streaming Sound Source that is managed by the streaming manager.

Public function Virtual Const

bool

 

IsManagedStreamingSoundWave

(
    const USoundWave* SoundWave
)

Returns true if this is a Sound Wave that is managed by the streaming manager.

Public function Virtual

bool

 

IsStreamingInProgress

(
    const USoundWave* SoundWave
)

Returns true if this Sound Wave is currently streaming a chunk.

Public function Virtual

void

 

RemoveDecoder

(
    ICompressedAudioInfo* Compress...
)

Removes the decoder from the streaming manager.

Protected function Virtual

void

 

RemoveReferenceToChunk

(
    const FAudioChunkHandle& InHandle
)

This can be used to decrement reference counted handles to audio chunks.

Public function Virtual

void

 

RemoveStreamingSoundSource

(
    FSoundSource* SoundSource
)

Removes a Sound Source from the streaming manager.

Public function Virtual

void

 

RemoveStreamingSoundWave

(
    USoundWave* SoundWave
)

Removes a Sound Wave from the streaming manager.

Public function Virtual

int32

 

RenderStatAudioStreaming

(
    UWorld* World,
    FViewport* Viewport,
    FCanvas* Canvas,
    int32 X,
    int32 Y,
    const FVector* ViewLocation,
    const FRotator* ViewRotation
)

Used for rendering debug info:

Public function Virtual

bool

 

RequestChunk

(
    USoundWave* SoundWave,
    uint32 ChunkIndex,
    TFunction< void...,
    ENamedThreads::Type ThreadToCallOnL...,
    bool bForImmediatePlayback
)

IAudioStreamingManager interface (used functions)

Public function Virtual

void

 

SetProfilingMode

(
    bool bEnabled
)

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

Public function Virtual

uint64

 

TrimMemory

(
    uint64 NumBytesToFree
)

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

Overridden from IStreamingManager

Name Description

Public function Virtual

void

 

AddLevel

(
    ULevel* Level
)

Adds a ULevel that has already prepared StreamingData to the streaming manager.

Public function Virtual

int32

 

BlockTillAllRequestsFinished

(
    float TimeLimit,
    bool bLogResults
)

Blocks till all pending requests are fulfilled.

Public function Virtual

void

 

CancelForcedResources()

Cancels the timed Forced resources (i.e used the Kismet action "Stream In Textures").

Public function Virtual

void

 

NotifyLevelChange()

Notifies manager of "level" change.

Public function Virtual

void

 

NotifyLevelOffset

(
    ULevel* Level,
    const FVector& Offset
)

Notifies manager that level primitives were shifted

Public function Virtual

void

 

RemoveLevel

(
    ULevel* Level
)

Removes a ULevel from the streaming manager.

Public function Virtual

void

 

SetDisregardWorldResourcesForFrames

(
    int32 NumFrames
)

Don't stream world resources for the next NumFrames.

Public function Virtual

void

 

UpdateResourceStreaming

(
    float DeltaTime,
    bool bProcessEverything
)

Updates streaming, taking into account all current view infos.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss