UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Audio::FPatchOutput Struct Reference

#include <MultithreadedPatching.h>

Public Member Functions

SIGNALPROCESSING_API FPatchOutput (int32 InMaxCapacity, float InGain=1.0f)
 
SIGNALPROCESSING_API FPatchOutput ()
 
virtual SIGNALPROCESSING_API ~FPatchOutput ()
 
SIGNALPROCESSING_API int32 PopAudio (float *OutBuffer, int32 NumSamples, bool bUseLatestAudio)
 
SIGNALPROCESSING_API int32 MixInAudio (float *OutBuffer, int32 NumSamples, bool bUseLatestAudio)
 
SIGNALPROCESSING_API int32 GetNumSamplesAvailable () const
 
SIGNALPROCESSING_API bool WaitUntilNumSamplesAvailable (int32 NumSamples, uint32 TimeOutMilliseconds=MAX_uint32)
 
SIGNALPROCESSING_API bool IsInputStale () const
 

Friends

class FPatchInput
 
class FPatchMixer
 
class FPatchSplitter
 

Detailed Description

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);

Constructor & Destructor Documentation

◆ FPatchOutput() [1/2]

Audio::FPatchOutput::FPatchOutput ( int32  InMaxCapacity,
float  InGain = 1.0f 
)

◆ FPatchOutput() [2/2]

Audio::FPatchOutput::FPatchOutput ( )

The default constructor will result in an uninitialized, disconnected patch point.

◆ ~FPatchOutput()

Audio::FPatchOutput::~FPatchOutput ( )
virtual

Member Function Documentation

◆ GetNumSamplesAvailable()

int32 Audio::FPatchOutput::GetNumSamplesAvailable ( ) const

Returns the current number of samples buffered on this output.

◆ IsInputStale()

bool Audio::FPatchOutput::IsInputStale ( ) const

Returns true if the input for this patch has been destroyed.

◆ MixInAudio()

int32 Audio::FPatchOutput::MixInAudio ( float OutBuffer,
int32  NumSamples,
bool  bUseLatestAudio 
)

Sums the minimum of NumSamples or however many samples are available into OutBuffer. Returns the number of samples summed into OutBuffer.

◆ PopAudio()

int32 Audio::FPatchOutput::PopAudio ( float OutBuffer,
int32  NumSamples,
bool  bUseLatestAudio 
)

Copies the minimum of NumSamples or however many samples are available into OutBuffer. Returns the number of samples copied, or -1 if this output's corresponding input has been destroyed.

◆ WaitUntilNumSamplesAvailable()

bool Audio::FPatchOutput::WaitUntilNumSamplesAvailable ( int32  NumSamples,
uint32  TimeOutMilliseconds = MAX_uint32 
)

Pauses the current thread until there are the given number of samples available to pop. Will return true if it succeeded, false if it timed out.

Friends And Related Symbol Documentation

◆ FPatchInput

friend class FPatchInput
friend

◆ FPatchMixer

friend class FPatchMixer
friend

◆ FPatchSplitter

friend class FPatchSplitter
friend

The documentation for this struct was generated from the following files: