FMixerSubmix

Windows
MacOS
Linux

References

Module

AudioMixer

Header

/Engine/Source/Runtime/AudioMixer/Public/AudioMixerSubmix.h

Include

#include "AudioMixerSubmix.h"

Syntax

class FMixerSubmix

Variables

Name Description

Protected variable

uint8: 1

 

bApplyOutputVolumeScale

Whether or not to apply a volume scale to output.

Protected variable

uint8: 1

 

bIsBackgroundMuted

Whether or not this submix is muted.

Protected variable

FThreadSafeBool

 

bIsEnvelopeFollowing

Bool set to true when envelope following is enabled.

Protected variable

uint8: 1

 

bIsRecording

Bool set to true when this submix is recording data.

Protected variable

FCriticalSectio...

 

BufferListenerCriticalSection

Critical section used for modifying and interacting with buffer listeners.

Protected variable

TArray< ISubmix...

 

BufferListeners

List of submix buffer listeners.

Protected variable

TMap< uint32, F...

 

ChildSubmixes

Child submixes.

Protected variable

TQueue< TFuncti...

 

CommandQueue

Submix command queue to shuffle commands from audio thread to audio render thread.

Protected variable

AlignedFloatBuf...

 

DownmixedBuffer

Protected variable

FCriticalSectio...

 

EffectChainMutationCriticalSection

Critical section for mutation of the effect chain.

Protected variable

TArray< FSubmix...

 

EffectSubmixChain

The effect chain of this submix, based on the sound submix preset chain.

Protected variable

FEndpointData

 

EndpointData

Protected variable

FCriticalSectio...

 

EnvelopeCriticalSection

Protected variable

TArray< Audio::...

 

EnvelopeFollowers

Protected variable

int32

 

EnvelopeNumChannels

Protected variable

float[8]

 

EnvelopeValues

Envelope following data.

Protected variable

uint32

 

Id

This mixer submix's Id.

Protected variable

float

 

InitializedOutputVolume

The output volume of the submix set via the USoundSubmix property. Can be set in the editor.

Protected variable

AlignedFloatBuf...

 

InputBuffer

Protected variable

FMixerDevice &#...

 

MixerDevice

Owning mixer device.

Protected variable

TMap< FMixerSou...

 

MixerSourceVoices

Map of mixer source voices with a given send level for this submix.

Protected variable

AlignedFloatBuf...

 

MonoMixBuffer

This buffer is used to downmix the submix output to mono before submitting it to the SpectrumAnalyzer.

Protected variable

int32

 

NumChannels

Protected variable

int32

 

NumSamples

Protected variable

int32

 

NumSubmixEffects

Returns the number of submix effects.

Protected variable

FOnSubmixEnvelo...

 

OnSubmixEnvelope

Multi-cast delegate to broadcast envelope data from this submix instance.

Protected variable

float

 

OutputVolume

The current dynamic output volume.

Protected variable

const USoundSub...

 

OwningSubmixObject

Handle back to the owning USoundSubmix. Used when the device is shutdown to prematurely end a recording.

Protected variable

TWeakPtr< FMixe...

 

ParentSubmix

Parent submix.

Protected variable

FCriticalSectio...

 

RecordingCriticalSection

Critical section used for when we are appending recorded data.

Protected variable

AlignedFloatBuf...

 

RecordingData

This buffer is used for recorded output of the submix.

Protected variable

AlignedFloatBuf...

 

ScratchBuffer

Protected variable

FSoundfieldStre...

 

SoundfieldStreams

Protected variable

AlignedFloatBuf...

 

SourceInputBuffer

Protected variable

TUniquePtr< FSp...

 

SpectrumAnalyzer

Spectrum analyzer:

Protected variable

float

 

TargetOutputVolume

The target dynamic output volume.

Constructors

Name Description

Public function

FMixerSubmix

(
    FMixerDevice* InMixerDevice
)

Destructors

Name Description

Public function Virtual

~FMixerSubmix()

Functions

Name Description

Public function

void

 

AddChildSubmix

Adds the given submix to this submix's children.

Public function

void

 

AddEnvelopeFollowerDelegate

(
    const FOnSubmixEnvelopeBP& OnSubmi...
)

Adds an envelope follower delegate.

Public function

void

 

AddOrSetSourceVoice

(
    FMixerSourceVoice* InSourceVoi...,
    const float SendLevel
)

Add (if not already added) or sets the amount of the source voice's send amount.

Public function

void

 

AddSoundEffectSubmix

(
    uint32 SubmixPresetId,
    FSoundEffectSubmixPtr InSoundEffect...
)

Appends the effect submix to the effect submix chain.

Public function

void

 

BroadcastEnvelope()

Broadcast the envelope value on the game thread.

Public function

void

 

ClearSoundEffectSubmixes()

Clears all submix effects from the effect submix chain.

Protected function Static

void

 

DownmixBuffer

(
    const int32 InChannels,
    const AlignedFloatBuffer& InBuffer,
    const int32 OutChannels,
    AlignedFloatBuffer& OutNewBuffer
)

Down mix the given buffer to the desired down mix channel count.

Public function

FSoundfieldS...

 

GetDefaultPositionalDataForAudioDevice()

Public function Const

uint32

 

GetId()

Returns the mixer submix Id.

Public function

FAudioPlugin...

 

GetInitializationParamsForSoundfieldStream()

Public function

FSoundfieldE...

 

GetKeyForSubmixEncoding()

Get a unique key for this submix's format and settings.

Public function

void

 

GetMagnitudeForFrequencies

(
    const TArray< float >& InFrequenci...,
    TArray< float >& OutMagnitudes
)

Gets the most recent magnitude values for each corresponding value in InFrequencies (in Hz).

Public function Const

int32

 

GetNumChainEffects()

Returns the number of effects in this submix's effect chain.

Public function Const

int32

 

GetNumEffects()

Returns the number of wet effects in this submix.

Public function Const

int32

 

GetNumOutputChannels()

Returns the output channels this submix is rendering to.

Public function Const

int32

 

GetNumSourceVoices()

Returns the number of source voices currently a part of this submix.

Public function

TWeakPtr< FM...

 

GetParentSubmix()

Gets this submix's parent submix.

Public function

void

 

GetPhaseForFrequencies

(
    const TArray< float >& InFrequenci...,
    TArray< float >& OutPhases
)

Gets the most recent phase values for each corresponding value in InFrequencies (in Hz).

Public function Const

int32

 

GetSampleRate()

Returns the device sample rate this submix is rendering to.

Public function Const

int32

 

GetSizeOfSubmixChain()

Returns the size of the submix chain.

Public function

ISoundfieldF...

 

GetSoundfieldFactory()

Protected function Const

FName

 

GetSoundfieldFormat()

Public function

ISoundfieldE...

 

GetSoundfieldSettings()

Public function Const

int32

 

GetSubmixChannels()

Gets the submix channels channels.

Public function

FSoundEffect...

 

GetSubmixEffect

(
    const int32 InIndex
)

Returns the submix effect at the given effect chain index.

Protected function

TUniquePtr< ...

 

GetTranscoderForChildSubmix

(
    const TSharedPtr< Audio::FMixerSubm...
)

Public function

void

 

Init

(
    const USoundSubmixBase* InSoun...,
    bool bAllowReInit
)

Initialize the submix object with the USoundSubmix ptr. Sets up child and parent connects.

Protected function

void

 

InitInternal()

Initialize the submix internal.

Public function Const

bool

 

IsDefaultEndpointSubmix()

Returns true if this submix sends it's audio to the default endpoint.

Public function Const

bool

 

IsExternalEndpointSubmix()

Returns true if this submix sends its audio to an IAudioEndpoint.

Public function Const

bool

 

IsSoundfieldEndpointSubmix()

Returns true if this submix sends its audio to an ISoundfieldEndpoint.

Public function Const

bool

 

IsSoundfieldSubmix()

Returns true if this submix is encoded to a soundfield.

Protected function

void

 

MixBufferDownToMono

(
    const AlignedFloatBuffer& InBuffer,
    int32 NumInputChannels,
    AlignedFloatBuffer& OutBuffer
)

Protected function

void

 

MixInChildSubmix

(
    FChildSubmixInfo& Child,
    ISoundfieldAudioPacket& PacketToSu...
)

Calls ProcessAudio on the child submix, performs all neccessary conversions and mixes in it's resulting audio.

Protected function

void

 

MixInSource

(
    const ISoundfieldAudioPacket& InAu...,
    const ISoundfieldEncodingSettingsPr...,
    ISoundfieldAudioPacket& PacketToSu...
)

Encode a source and sum it into the mixed soundfield.

Public function

void

 

OnStartRecordingOutput

(
    float ExpectedDuration
)

This is called by the corresponding USoundSubmix when StartRecordingOutput is called.

Public function

AlignedFloat...

 

OnStopRecordingOutput

(
    float& OutNumChannels,
    float& OutSampleRate
)

This is called by the corresponding USoundSubmix when StopRecordingOutput is called.

Public function

void

 

PauseRecordingOutput()

This is called by the corresponding USoundSubmix when PauseRecording is called.

Public function

void

 

ProcessAudio

(
    ISoundfieldAudioPacket& OutputAudi...
)

Function which processes audio.

Public function

void

 

ProcessAudio

(
    AlignedFloatBuffer& OutAudio
)

Function which processes audio.

Public function

void

 

ProcessAudioAndSendToEndpoint()

This should be called if this submix doesn't send it's audio to a parent submix, but rather an external endpoint.

Protected function

void

 

PumpCommandQueue()

Pump command queue.

Public function

void

 

RegisterBufferListener

(
    ISubmixBufferListener* BufferL...
)

Register buffer listener with this submix.

Public function

void

 

RemoveChildSubmix

Removes the given submix from this submix's children.

Public function

void

 

RemoveSoundEffectSubmix

(
    uint32 SubmixPresetId
)

Removes the submix effect from the effect submix chain.

Public function

void

 

RemoveSoundEffectSubmixAtIndex

(
    int32 InIndex
)

Removes the submix effect from the effect submix chain at the given submix index.

Public function

void

 

RemoveSourceVoice

(
    FMixerSourceVoice* InSourceVoi...
)

Removes the given source voice from the submix.

Public function

void

 

ReplaceSoundEffectSubmix

(
    int32 InIndex,
    int32 InPresetId,
    FSoundEffectSubmixPtr InEffectInsta...
)

Swaps effect for provided submix at the given index. Fails if effect at index doesn't exist

Public function

void

 

ResumeRecordingOutput()

This is called by the corresponding USoundSubmix when ResumeRecording is called.

Public function

void

 

SetBackgroundMuted

(
    bool bInMuted
)

Whether or not this submix instance is muted.

Public function

void

 

SetDynamicOutputVolume

(
    float InVolume
)

Sets the dynamic output volume.

Public function

void

 

SetOutputVolume

(
    float InVolume
)

Sets the static output volume of the submix.

Public function

void

 

SetParentSubmix

Sets the parent submix to the given submix.

Public function

void

 

SetSoundfieldFactory

(
    ISoundfieldFactory* InSoundfie...
)

This must be called on the entire submix graph before calling SetupSoundfieldStreams.

Public function

void

 

SetupEndpoint

(
    ISoundfieldEndpointFactory* In...,
    const USoundfieldEndpointSettingsBa...
)

Public function

void

 

SetupEndpoint

(
    IAudioEndpointFactory* InFacto...,
    const UAudioEndpointSettingsBase&#...
)

Protected function

void

 

SetupSoundfieldEncodersForChildren()

Protected function

void

 

SetupSoundfieldEncodingForChild

(
    FChildSubmixInfo& InChild
)

Protected function

void

 

SetUpSoundfieldPositionalData

(
    const TSharedPtr< Audio::FMixerSubm...
)

This sets up the ambisonics positional data for speakers, based on what new format we need to convert to.

Protected function

void

 

SetupSoundfieldStreamForParent()

Check to see if we need to decode from ambisonics for parent.

Public function

void

 

SetupSoundfieldStreams

(
    const USoundfieldEncodingSettingsBa...,
    TArray< USoundfieldEffectBase*...,
    ISoundfieldFactory* InSoundfie...
)

Updates settings, potentially creating or removing ambisonics streams based on what types of submixes this submix is connected to.

Public function

void

 

StartEnvelopeFollowing

(
    int32 AttackTime,
    int32 ReleaseTime
)

Starts envelope following with the given attack time and release time.

Public function

void

 

StartSpectrumAnalysis

(
    const FSpectrumAnalyzerSettings& I...
)

Initializes a new FFT analyzer for this submix and immediately begins feeding audio to it.

Public function

void

 

StopEnvelopeFollowing()

Stops envelope following the submix.

Public function

void

 

StopSpectrumAnalysis()

Terminates whatever FFT Analyzer is being used for this submix.

Protected function

void

 

SubmixCommand

(
    TFunction< void()> Command
)

Add command to the command queue.

Public function

void

 

TeardownSoundfieldStreams()

Public function

void

 

UnregisterBufferListener

(
    ISubmixBufferListener* BufferL...
)

Unregister buffer listener with this submix.

Public function

void

 

UpdateEndpointSettings

Public function

void

 

UpdateEndpointSettings

Protected function

void

 

UpdateListenerRotation

(
    const FQuat& InRotation
)

Classes

Name

Description

Protected struct

FEndpointData

Protected struct

FSoundfieldEffectProcessorData

Individual processor in our

Protected struct

FSoundfieldStreams

Protected struct

FSubmixEffectInfo

Info struct for a submix effect instance.

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