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

#include <SoundWaveProxyReader.h>

Classes

struct  FSettings
 

Public Types

using FSoundWaveProxyRef = TSharedRef< FSoundWaveProxy, ESPMode::ThreadSafe >
 

Public Member Functions

ENGINE_API void SetIsLooping (bool bInIsLooping)
 
bool IsLooping () const
 
ENGINE_API void SetLoopStartTime (float InLoopStartTimeInSeconds)
 
ENGINE_API void SetLoopDuration (float InLoopDurationInSeconds)
 
float GetSampleRate () const
 
int32 GetNumChannels () const
 
int32 GetFrameIndex () const
 
int32 GetNumFramesInWave () const
 
int32 GetNumFramesInLoop () const
 
int32 GetLoopStartFrameIndex () const
 
int32 GetLoopEndFrameIndex () const
 
ENGINE_API bool SeekToTime (float InSeconds)
 
ENGINE_API bool SeekToFrame (uint32 InFrameNum)
 
ENGINE_API int32 PopAudio (Audio::FAlignedFloatBuffer &OutBuffer)
 
ENGINE_API bool CanProduceMoreAudio () const
 
bool HasFailed () const
 

Static Public Member Functions

static uint32 ConformDecodeSize (uint32 InMaxDesiredDecodeSizeInFrames)
 
static ENGINE_API TUniquePtr< FSoundWaveProxyReaderCreate (FSoundWaveProxyRef InWaveProxy, const FSettings &InSettings)
 

Static Public Attributes

static constexpr uint32 DefaultMinDecodeSizeInFrames = 128
 
static constexpr uint32 DecodeSizeQuantizationInFrames = 128
 
static constexpr float MinLoopDurationInSeconds = 0.05f
 
static constexpr float MaxLoopDurationInSeconds = 60.f * 60.f * 365.f * 10.f
 

Detailed Description

FSoundWaveProxyReader reads a FWaveProxy and outputs 32 bit interleaved audio.

FSoundWaveProxyReader provides controls for looping and relevant frame index values.

Member Typedef Documentation

◆ FSoundWaveProxyRef

Member Function Documentation

◆ CanProduceMoreAudio()

bool FSoundWaveProxyReader::CanProduceMoreAudio ( ) const

Returns TRUE if the reader can produce audio (eg. has a valid decoder, it can still decode, etc.)

Returns
true on success, false on failure.

◆ ConformDecodeSize()

uint32 FSoundWaveProxyReader::ConformDecodeSize ( uint32  InMaxDesiredDecodeSizeInFrames)
static

◆ Create()

TUniquePtr< FSoundWaveProxyReader > FSoundWaveProxyReader::Create ( FSoundWaveProxyRef  InWaveProxy,
const FSettings InSettings 
)
static

Create a wave proxy reader.

Parameters
InWaveProxy- A TSharedRef of a FSoundWaveProxy which is to be played.
InSettings- Reader settings.

◆ GetFrameIndex()

int32 FSoundWaveProxyReader::GetFrameIndex ( ) const
inline

Returns the index of the playhead within the complete wave.

◆ GetLoopEndFrameIndex()

int32 FSoundWaveProxyReader::GetLoopEndFrameIndex ( ) const
inline

◆ GetLoopStartFrameIndex()

int32 FSoundWaveProxyReader::GetLoopStartFrameIndex ( ) const
inline

◆ GetNumChannels()

int32 FSoundWaveProxyReader::GetNumChannels ( ) const
inline

◆ GetNumFramesInLoop()

int32 FSoundWaveProxyReader::GetNumFramesInLoop ( ) const
inline

◆ GetNumFramesInWave()

int32 FSoundWaveProxyReader::GetNumFramesInWave ( ) const
inline

◆ GetSampleRate()

float FSoundWaveProxyReader::GetSampleRate ( ) const
inline

◆ HasFailed()

bool FSoundWaveProxyReader::HasFailed ( ) const
inline

Returns TRUE if the reader has encountered a decoder failure.

Returns
true if there is a failure, false if no failure.

◆ IsLooping()

bool FSoundWaveProxyReader::IsLooping ( ) const
inline

Returns true if the audio will be looped, false otherwise.

◆ PopAudio()

int32 FSoundWaveProxyReader::PopAudio ( Audio::FAlignedFloatBuffer OutBuffer)

Pops audio from reader and copies audio into OutBuffer. It returns the number of samples copied. Samples not written to will be set to zero.

Copies audio into OutBuffer. It returns the number of samples copied. Samples not written to will be set to zero.

◆ SeekToFrame()

bool FSoundWaveProxyReader::SeekToFrame ( uint32  InFrameNum)

Seeks to position in wave at a specific frame.

Parameters
InFrameNum- The specific frame to seek the playhead
Returns
true on success, false on failure.

◆ SeekToTime()

bool FSoundWaveProxyReader::SeekToTime ( float  InSeconds)

Seeks to position in wave.

Parameters
InSeconds- The location to seek the playhead
Returns
true on success, false on failure.

◆ SetIsLooping()

void FSoundWaveProxyReader::SetIsLooping ( bool  bInIsLooping)

Set whether the reader should loop the audio or not.

◆ SetLoopDuration()

void FSoundWaveProxyReader::SetLoopDuration ( float  InLoopDurationInSeconds)

Sets the duration of the loop in seconds.

If the value is negative, the MaxLoopDurationInSeconds will be used which will effectively loop at the end of the file.

Sets the duration of the loop in seconds. If the value is negative, the loop duration consists of the entire file.

◆ SetLoopStartTime()

void FSoundWaveProxyReader::SetLoopStartTime ( float  InLoopStartTimeInSeconds)

Sets the beginning position of the loop.

Member Data Documentation

◆ DecodeSizeQuantizationInFrames

constexpr uint32 FSoundWaveProxyReader::DecodeSizeQuantizationInFrames = 128
staticconstexpr

Some codecs have strict requirements on decode size. In order to be functional with all supported codecs, the decode size must be a multiple of 128.

◆ DefaultMinDecodeSizeInFrames

constexpr uint32 FSoundWaveProxyReader::DefaultMinDecodeSizeInFrames = 128
staticconstexpr

Minimum number of frames to decode per a call to the decoder.

◆ MaxLoopDurationInSeconds

constexpr float FSoundWaveProxyReader::MaxLoopDurationInSeconds = 60.f * 60.f * 365.f * 10.f
staticconstexpr

Maximum duration of a loop.

10 years. ridiculously high. This exists to prevent floating point undefined overflow behavior if performing calculations with TNumericLimits<float>::Max().

◆ MinLoopDurationInSeconds

constexpr float FSoundWaveProxyReader::MinLoopDurationInSeconds = 0.05f
staticconstexpr

Minimum duration of a loop.


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