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 | |
|---|---|---|---|
| void | Empty () |
||
| uint32 | GetCapacity () |
Get the current capacity of the buffer. | |
| uint32 | Num () |
Get number of samples that can be popped off of the buffer. | |
| int32 | Same as Pop(), but does not increment the read counter. | ||
| bool | Peek
(
SampleType& OutElement |
Peeks a single element. returns false if the element is empty. | |
| DisjointedArrayView< const SampleType > | PeekInPlace
(
uint32 NumSamples |
Same Peek(), but provides a (possibly) disjointed view of the memory in-place Push calls while the returned view is being accessed is undefined behavior | |
| int32 | Pops some amount of samples into this circular buffer. Returns the amount of samples read. | ||
| int32 | Pops some amount of samples into this circular buffer. Returns the amount of samples read. | ||
| SampleType | Pop () |
Pops a single element. | |
| DisjointedArrayView< const SampleType > | PopInPlace
(
uint32 NumSamples |
Same as Pop(), but provides a (possibly) disjinted view of memory in-place Push calls while the returned view is being accessed is undefined behavior | |
| int32 | Push
(
TArrayView< const SampleType > InBuffer |
Push an array of values into circular buffer. | |
| bool | Push
(
SampleType&& InElement |
||
| bool | Push
(
const SampleType& InElement |
Push a single sample onto this buffer. Returns false if the buffer is full. | |
| int32 | Pushes some amount of samples into this circular buffer. | ||
| int32 | 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 capacity. | ||
| void | |||
| void | SetCapacity
(
uint32 InCapacity |
||
| void | 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 |