Navigation
API > API/Runtime > API/Runtime/SignalProcessing > API/Runtime/SignalProcessing/DSP
References
| Module | SignalProcessing |
| Header | /Engine/Source/Runtime/SignalProcessing/Public/DSP/Dsp.h |
| Include | #include "DSP/Dsp.h" |
Syntax
template<typename SampleType, size_t Alignment>
class TCircularAudioBuffer
Remarks
Basic implementation of a circular buffer built for pushing and popping arbitrary amounts of data at once. Designed to be thread safe for SPSC; However, if Push() and Pop() are both trying to access an overlapping area of the buffer, One of the calls will be truncated. Thus, it is advised that you use a high enough capacity that the producer and consumer are never in contention.
Constructors
| Type | Name | Description | |
|---|---|---|---|
TCircularAudioBuffer
(
const TCircularAudioBuffer< SampleType, Alignment >& InOther |
|||
TCircularAudioBuffer
(
uint32 InCapacity |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint32 | GetCapacity () |
Get the current capacity of the buffer. | |
| uint32 | Num () |
Get number of samples that can be popped off of the buffer. | |
| bool | Peek
(
SampleType& OutElement |
Peeks a single element. returns false if the element is empty. | |
| int32 | Peek
(
SampleType* OutBuffer, |
Same as Pop(), but does not increment the read counter. | |
| SampleType | Pop () |
Pops a single element. | |
| int32 | Pop
(
uint32 NumSamples |
Pops some amount of samples into this circular buffer. Returns the amount of samples read. | |
| int32 | Pop
(
SampleType* OutBuffer, |
Pops some amount of samples into this circular buffer. Returns the amount of samples read. | |
| int32 | Push
(
TArrayView< const SampleType > InBuffer |
Push an array of values into circular buffer. | |
| bool | Push
(
const SampleType& InElement |
Push a single sample onto this buffer. Returns false if the buffer is full. | |
| bool | Push
(
SampleType&& InElement |
||
| int32 | Push
(
const SampleType* InBuffer, |
Pushes some amount of samples into this circular buffer. | |
| int32 | PushZeros
(
uint32 NumSamplesOfZeros |
Pushes some amount of zeros into the circular buffer. | |
| uint32 | Remainder () |
Get number of samples that can be pushed onto the buffer before it is full. | |
| void | Reserve
(
uint32 InMinimumCapacity, |
Reserve capacity. | |
| void | Reset
(
uint32 InCapacity |
||
| void | SetCapacity
(
uint32 InCapacity |
||
| void | SetNum
(
uint32 NumSamples, |
When called, seeks the read or write cursor to only retain either the NumSamples latest data (if bRetainOldestSamples is false) or the NumSamples oldest data (if bRetainOldestSamples is true) in the buffer. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| TCircularAudioBuffer & | operator=
(
const TCircularAudioBuffer< SampleType, Alignment >& InOther |