FPatchMixer

This class is used for retrieving and mixing down audio from multiple threads.

Windows
MacOS
Linux

References

Module

SignalProcessing

Header

/Engine/Source/Runtime/SignalProcessing/Public/DSP/MultithreadedPatching.h

Include

#include "DSP/MultithreadedPatching.h"

Syntax

class FPatchMixer

Remarks

This class is used for retrieving and mixing down audio from multiple threads. Important to note that this is MPSC: while multiple threads can enqueue audio on an instance of FPatchMixer using instances of FPatchInput, only one thread can call PopAudio safely.

Constructors

Name Description

Public function

FPatchMixer()

Constructor.

Functions

Name Description

Public function

FPatchInput

 

AddNewInput

(
    int32 MaxLatencyInSamples,
    float InGain
)

Adds a new input to the tap collector.

Public function

void

 

DisconnectAllInputs()

Disconnect everything currently connected to this mixer.

Public function

int32

 

MaxNumberOfSamplesThatCanBePopped()

This function call gets the maximum number of samples that's safe to pop, based on the thread with the least amount of samples buffered.

Public function

int32

 

Num()

This returns the number of inputs currently connected to this patch mixer.

Public function

int32

 

PopAudio

(
    float* OutBuffer,
    int32 OutNumSamples,
    bool bUseLatestAudio
)

Mixes all inputs into a single buffer.

Public function

void

 

RemovePatch

(
    const FPatchInput& TapInput
)

Removes a tap from the tap collector.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss