Navigation
API > API/Runtime > API/Runtime/AudioLinkEngine
Simple locking circular buffer Uses 32bit wrap around logic explained here: https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/
| Name | FLockingCircularSampleBuffer |
| Type | class |
| Header File | /Engine/Source/Runtime/AudioLink/AudioLinkEngine/Public/BufferedListenerBase.h |
| Include Path | #include "BufferedListenerBase.h" |
Syntax
class FLockingCircularSampleBuffer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLockingCircularSampleBuffer
(
int32 InInitialCapacity |
BufferedListenerBase.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Buffer | TArray< float > | BufferedListenerBase.h | ||
| CS | FCriticalSection | BufferedListenerBase.h | ||
| Mask | uint32 | BufferedListenerBase.h | ||
| Read | uint32 | BufferedListenerBase.h | ||
| Write | uint32 | BufferedListenerBase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void EnsureCapacity
(
int32 InMinCapacity |
Grow the buffer to at least InMinCapacity if current capacity is insufficient. | BufferedListenerBase.h | |
void Flush() |
Reset read/write pointers, discarding all buffered data without reallocating. | BufferedListenerBase.h | |
int32 GetCapacity() |
BufferedListenerBase.h | ||
FCriticalSection & GetCriticialSection () |
Allow the caller to lock the CS ahead of calling (if necessary) | BufferedListenerBase.h | |
const FCriticalSection & GetCriticialSection () |
BufferedListenerBase.h | ||
int32 Num() |
BufferedListenerBase.h | ||
int32 Pop
(
float* OutBuffer, |
BufferedListenerBase.h | ||
int32 Push
(
const float* InBuffer, |
BufferedListenerBase.h | ||
int32 PushZeros
(
int32 InNumSamplesOfSilence |
BufferedListenerBase.h | ||
int32 Remainder() |
Get number of samples that can be pushed onto the buffer before it is full. | BufferedListenerBase.h | |
void SetCapacity
(
int32 InCapacity |
This doesn't preserve contents. | BufferedListenerBase.h |