Module |
|
Header |
/Engine/Source/Runtime/SignalProcessing/Public/DSP/Dsp.h |
Include |
#include "DSP/Dsp.h" |
template<typename SampleType>
class TCircularAudioBuffer
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.
Name | Description | |
---|---|---|
|
TCircularAudioBuffer() |
|
|
TCircularAudioBuffer ( |
Name | Description | ||
---|---|---|---|
|
GetCapacity() |
Get the current capacity of the buffer. |
|
|
Num() |
Get number of samples that can be popped off of the buffer. |
|
|
Peek ( |
Same as Pop(), but does not increment the read counter. |
|
|
Pop ( |
Pops some amount of samples into this circular buffer. Returns the amount of samples read. |
|
|
Push ( |
Pushes some amount of samples into this circular buffer. Returns the amount of samples written. |
|
|
Remainder() |
Get number of samples that can be pushed onto the buffer before it is full. |
|
|
SetCapacity ( |
||
|
SetNum |
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. |