Navigation
API > API/Runtime > API/Runtime/SignalProcessing
This class can be thought of as an output for a single constructed instance of FPatchInput. Each FPatchOutput can only be connected to one FPatchInput. To route multiple outputs, see FPatchSplitter. To route multiple inputs, see FPatchMixer.
Example usage:
FPatchOutputStrongPtr NewOutput(new FPatchOutput(4096)); FPatchInput NewInput(NewOutput);
// On one thread, push audio to the output: NewInput.PushAudio(AudioBufferPtr, AudioBufferNumSamples);
// and on a seperate thread, retrieve the audio: NewOutput->PopAudio(OutAudioBufferPtr, AudioBufferNumSamples);
| Name | FPatchOutput |
| Type | struct |
| Header File | /Engine/Source/Runtime/SignalProcessing/Public/DSP/MultithreadedPatching.h |
| Include Path | #include "DSP/MultithreadedPatching.h" |
Syntax
struct FPatchOutput
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPatchOutput () |
The default constructor will result in an uninitialized, disconnected patch point. | DSP/MultithreadedPatching.h | |
FPatchOutput
(
int32 InMaxCapacity, |
DSP/MultithreadedPatching.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FPatchOutput() |
DSP/MultithreadedPatching.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| PatchIDCounter | TAtomic< int32 > | DSP/MultithreadedPatching.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InternalBuffer | TCircularAudioBuffer< float > | Internal buffer. | DSP/MultithreadedPatching.h | |
| MixingBuffer | FAlignedFloatBuffer | For MixInAudio, audio is popped off of InternalBuffer onto here, and then mixed into OutBuffer in MixInAudio. | DSP/MultithreadedPatching.h | |
| NumAliveInputs | std::atomic< int32 > | Counter that is incremented/decremented to allow FPatchInput to be copied around safely. | DSP/MultithreadedPatching.h | |
| PatchID | int32 | This is used to breadcrumb the FPatchOutput when we want to delete it. | DSP/MultithreadedPatching.h | |
| PreviousGain | float | DSP/MultithreadedPatching.h | ||
| SamplesPushedEvent | std::atomic< FEvent * > | Event to pause the current thread until a given number of samples has been filled. | DSP/MultithreadedPatching.h | |
| TargetGain | TAtomic< float > | This is applied in PopAudio or MixInAudio. | DSP/MultithreadedPatching.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 GetNumSamplesAvailable() |
Returns the current number of samples buffered on this output. | DSP/MultithreadedPatching.h | |
bool IsInputStale() |
Returns true if the input for this patch has been destroyed. | DSP/MultithreadedPatching.h | |
int32 MixInAudio
(
float* OutBuffer, |
Sums the minimum of NumSamples or however many samples are available into OutBuffer. | DSP/MultithreadedPatching.h | |
int32 PopAudio
(
float* OutBuffer, |
Copies the minimum of NumSamples or however many samples are available into OutBuffer. | DSP/MultithreadedPatching.h | |
bool WaitUntilNumSamplesAvailable
(
int32 NumSamples, |
Pauses the current thread until there are the given number of samples available to pop. | DSP/MultithreadedPatching.h |