![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <RuntimeResampler.h>
Public Member Functions | |
| UE_API | FRuntimeResampler (int32 InNumChannels) |
| UE_API void | SetFrameRatio (float InRatio, int32 InNumFramesToInterpolate=0) |
| UE_API int32 | GetNumInputFramesNeededToProduceOutputFrames (int32 InNumOutputFrames) const |
| UE_API int32 | GetNumOutputFramesProducedByInputFrames (int32 InNumInputFrames) const |
| UE_API int32 | ProcessCircularBuffer (FMultichannelCircularBuffer &InAudio, FMultichannelBuffer &OutAudio) |
| UE_API int32 | ProcessCircularBuffer (FMultichannelCircularBuffer &InAudio, FMultichannelBufferView &OutAudio) |
| UE_API void | ProcessInterleaved (TArrayView< const float > Input, TArrayView< float > Output, int32 &OutNumInputFramesConsumed, int32 &OutNumOutputFramesProduced) |
| UE_API void | Reset (int32 InNumChannels) |
Static Public Attributes | |
| static UE_API const float | MaxFrameRatio = 100.f |
| static UE_API const float | MinFrameRatio = 0.01f |
Linear interpolating resampler which supports any number of channels of audio, interleaved or deinterleaved. To support different types of input and output objects, add a new "Process..." method which wraps around calls to ProcessAudioInternal().
| Audio::FRuntimeResampler::FRuntimeResampler | ( | int32 | InNumChannels | ) |
Construct a linear resampler.
| InNumChannel | - Number of audio channels in input and output buffers. |
| int32 Audio::FRuntimeResampler::GetNumInputFramesNeededToProduceOutputFrames | ( | int32 | InNumOutputFrames | ) | const |
Returns the minimum number of input frames needed to produce the desired number of output frames given the current state of the resampler.
| InNumOutputFrames | - The desired number of output frames. |
| int32 Audio::FRuntimeResampler::GetNumOutputFramesProducedByInputFrames | ( | int32 | InNumInputFrames | ) | const |
Returns the maximum number of output frames that can be produced from the provided number of input frames given the current state of the resampler.
| InNumInputFrames | - The number of provided input frames. |
| int32 Audio::FRuntimeResampler::ProcessCircularBuffer | ( | FMultichannelCircularBuffer & | InAudio, |
| FMultichannelBuffer & | OutAudio | ||
| ) |
Consumes audio from the input buffer and produces audio in the output buffer. The desired number of frames to produce is determined by the output audio buffer size. For the desired number of samples to be produced, the input audio must have the minimum number of frames needed to produce the output frames (see GetNumInputFramesNeededToProduceOutputFrames(...)). Input samples which are no longer needed are removed from the input buffer.
| InAudio | - Multichannel circular buffer of input audio. |
| OutAudio | - Multichannel buffer of output audio. FMultichannelBuffer |
| int32 Audio::FRuntimeResampler::ProcessCircularBuffer | ( | FMultichannelCircularBuffer & | InAudio, |
| FMultichannelBufferView & | OutAudio | ||
| ) |
Consumes audio from the input buffer and produces audio in the output buffer. The desired number of frames to produce is determined by the output audio buffer size. For the desired number of samples to be produced, the input audio must have the minimum number of frames needed to produce the output frames (see GetNumInputFramesNeededToProduceOutputFrames(...)). Input samples which are no longer needed are removed from the input buffer.
| InAudio | - Multichannel circular buffer of input audio. |
| OutAudio | - Multichannel buffer of output audio. FMultichannelBuffer |
| void Audio::FRuntimeResampler::ProcessInterleaved | ( | TArrayView< const float > | Input, |
| TArrayView< float > | Output, | ||
| int32 & | OutNumInputFramesConsumed, | ||
| int32 & | OutNumOutputFramesProduced | ||
| ) |
Consumes audio in an interleaved channel format from the input buffer and produces audio in the output buffer. The desired number of frames to produce is determined by the output audio buffer size. For the desired number of samples to be produced, the input audio must have the minimum number of frames needed to produce the output frames (see GetNumInputFramesNeededToProduceOutputFrames(...)).
| InAudio | - Multichannel interleaved audio to use as input. |
| OutAudio | - Buffer to receive multichannel interleaved output audio. |
| OutNumInputFramesConsumed | - Receives the actual number of frames of input consumed. |
| OutNumOutputFramesProduced | - Receives the actual number of frames of output produced. |
Reset the internal state of the resampler. Call this if the next audio data to be submitted is unrelated to the audio that has been submitted previously.
Sets the number of input frames to read per an output frame. 0.5 is half speed, 1.f is normal speed, 2.0 is double speed.
| InRatio | - Ratio of input frames consumed per an output frame produced. |
| InNumFramesToInterpolate | - Number of output frames over which to interpolate the frame ratio. |
|
static |
|
static |