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

#include <MediaAudioResampler.h>

Public Member Functions

MEDIAUTILS_API FMediaAudioResampler ()
 
MEDIAUTILS_API void Flush ()
 
MEDIAUTILS_API uint32 Generate (float *Output, FMediaTimeStamp &OutTime, const uint32 FramesRequested, float Rate, FTimespan Time, FMediaAudioSampleSource &SampleSource, uint32 &JumpFrame)
 
MEDIAUTILS_API void Initialize (const uint32 InOutputChannels, const uint32 InOutputSampleRate)
 

Protected Member Functions

MEDIAUTILS_API void ClearInput ()
 
MEDIAUTILS_API bool SetInput (const TSharedPtr< IMediaAudioSample, ESPMode::ThreadSafe > &Sample)
 

Constructor & Destructor Documentation

◆ FMediaAudioResampler()

FMediaAudioResampler::FMediaAudioResampler ( )

Default constructor.

Member Function Documentation

◆ ClearInput()

void FMediaAudioResampler::ClearInput ( )
protected

Clear the input samples.

See also
SetInput

◆ Flush()

void FMediaAudioResampler::Flush ( )

Flush the resampler.

◆ Generate()

uint32 FMediaAudioResampler::Generate ( float Output,
FMediaTimeStamp OutTime,
const uint32  FramesRequested,
float  Rate,
FTimespan  Time,
FMediaAudioSampleSource SampleSource,
uint32 JumpFrame 
)

Generate the next frame of audio.

Parameters
OutputThe output sample buffer (will be incremented by the number of sample values written).
OutTimeThe time of the first output frame that was returned.
FramesRequestedThe maximum number of frames to get.
RateThe current play rate.
TimeThe current play time.
SampleSourceThe object that provides more audio samples if needed.
JumpFrameFrame that a jump in time occured on.
Returns
The actual number of frames returned.

◆ Initialize()

void FMediaAudioResampler::Initialize ( const uint32  InOutputChannels,
const uint32  InOutputSampleRate 
)

Initialize the resampler.

Parameters
InOutputSampleRateDesired output sample rate.
See also
SetAudioSamples

◆ SetInput()

bool FMediaAudioResampler::SetInput ( const TSharedPtr< IMediaAudioSample, ESPMode::ThreadSafe > &  Sample)
protected

Set the audio sample to be resampled.

Parameters
SampleThe input audio sample.
Returns
true on success, false otherwise.
See also
ClearInput

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