Navigation
API > API/Runtime > API/Runtime/SignalProcessing
TSampleBuffer
| Name | TSampleBuffer |
| Type | class |
| Header File | /Engine/Source/Runtime/SignalProcessing/Public/SampleBuffer.h |
| Include Path | #include "SampleBuffer.h" |
Syntax
template<class SampleType>
class TSampleBuffer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSampleBuffer
(
const float* InBufferPtr, |
SampleBuffer.h | ||
| SampleBuffer.h | |||
TSampleBuffer
(
const TSampleBuffer& Other |
SampleBuffer.h | ||
TSampleBuffer
(
const FAlignedFloatBuffer& InData, |
SampleBuffer.h | ||
TSampleBuffer
(
const int16* InBufferPtr, |
SampleBuffer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TSampleBuffer() |
SampleBuffer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| NumChannels | int32 | The number of channels in the buffer. | SampleBuffer.h | |
| NumFrames | int32 | The number of frames in the buffer. | SampleBuffer.h | |
| NumSamples | int32 | The number of samples in the buffer. | SampleBuffer.h | |
| RawPCMData | TArray< SampleType > | Raw PCM data buffer | SampleBuffer.h | |
| SampleDuration | float | The duration of the buffer in seconds. | SampleBuffer.h | |
| SampleRate | int32 | The sample rate of the buffer | SampleBuffer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Append
(
const OtherSampleType* InputBuffer, |
Overload of Append that also sets the number of channels and sample rate. | SampleBuffer.h | |
void Append
(
const OtherSampleType* InputBuffer, |
Append audio data to internal buffer of different sample type of this sample buffer. | SampleBuffer.h | |
void Clamp
(
float Ceiling |
SampleBuffer.h | ||
void CopyFrom
(
const TArray< SampleType >& InArray, |
Copy from a container of the same element type | SampleBuffer.h | |
TArrayView< const SampleType > GetArrayView () |
SampleBuffer.h | ||
TArrayView< SampleType > GetArrayView () |
SampleBuffer.h | ||
float GetAudioFrameAtFractionalIndex
(
float InIndex, |
InIndex [0.0f, NumSamples - 1.0f] OutFrame is the multichannel output for one index value Returns InIndex wrapped between 0.0 and NumFrames | SampleBuffer.h | |
float GetAudioFrameAtPhase
(
float InPhase, |
InPhase [0, 1], wrapped, through duration of file (ignores sample rate) OutFrame is the multichannel output for one phase value Returns InPhase wrapped between 0.0 and 1.0 | SampleBuffer.h | |
float GetAudioFrameAtTime
(
float InTimeSec, |
InTimeSec, get the value of the buffer at the given time (uses sample rate) OutFrame is the multichannel output for one time value Returns InTimeSec wrapped between 0.0 and (NumSamples / SampleRate) | SampleBuffer.h | |
const SampleType * GetData() |
Gets the raw PCM data of the sound wave. | SampleBuffer.h | |
int32 GetNumChannels() |
Gets the number of channels of the sound wave. | SampleBuffer.h | |
int32 GetNumFrames() |
Gets the number of frames of the sound wave. | SampleBuffer.h | |
int32 GetNumSamples() |
Gets the number of samples of the sound wave. | SampleBuffer.h | |
float GetSampleDuration() |
SampleBuffer.h | ||
int32 GetSampleRate() |
Gets the sample rate of the sound wave. | SampleBuffer.h | |
void MixBufferToChannels
(
int32 InNumChannels |
SampleBuffer.h | ||
void Reset() |
SampleBuffer.h | ||
void SetNumFrames
(
int32 InNumFrames |
SampleBuffer.h | ||
void ZeroPad
(
int32 NumFramesToAppend |
Appends zeroes to the end of this buffer. | SampleBuffer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSampleBuffer & operator=
(
const TSampleBuffer& Other |
Vanilla assignment operator: | SampleBuffer.h | |
TSampleBuffer & operator=
(
const TSampleBuffer< OtherSampleType >& Other |
SampleType converting assignment operator: | SampleBuffer.h |