FMixerDevice

Windows
MacOS
Linux

Inheritance Hierarchy

IAudioMixer

FMixerDevice

References

Module

AudioMixer

Header

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

Include

#include "AudioMixerDevice.h"

Syntax

class FMixerDevice :
    public FAudioDevice,
    public Audio::IAudioMixer,
    public FGCObject

Variables

Name Description

Protected variable

TArray< FTransf...

 

ListenerTransforms

Public variable

FQuartzClockMan...

 

QuantizedEventClockManager

Clock Manager for quantized event handling on Audio Render Thread.

Constructors

Name Description

Public function

FMixerDevice

Destructors

Name Description

Public function

~FMixerDevice()

Functions

Name Description

Public function

void

 

AddMasterSubmixEffect

(
    FSoundEffectSubmixPtr SoundEffect
)

Add submix effect to master submix.

Public function

FPatchOutput...

 

AddPatchForAudioBus

(
    uint32 InAudioBusId,
    float InPatchGain
)

Public function

int32

 

AddSubmixEffect

(
    USoundSubmix* InSoundSubmix,
    FSoundEffectSubmixPtr SoundEffect
)

Add submix effect to given submix.

Public function

void

 

AudioRenderThreadCommand

(
    TFunction< void()> Command
)

Pushes the command to a audio render thread command queue to be executed on render thread.

Public function Const

void

 

CheckAudioRenderingThread()

Public function Const

void

 

CheckAudioThread()

Functions which check the thread it's called on and helps make sure functions are called from correct threads.

Public function

void

 

ClearMasterSubmixEffects()

Clear all submix effects from master submix.

Public function

void

 

ClearSubmixEffects

(
    USoundSubmix* InSoundSubmix
)

Clear all submix effects from given submix.

Public function

FMixerSubmix...

 

FindSubmixInstanceByObjectId

(
    uint32 InObjectId
)

Public function Const

void

 

Get2DChannelMap

(
    bool bIsVorbis,
    const int32 NumSourceChannels,
    const bool bIsCenterChannelOnly,
    Audio::AlignedFloatBuffer& OutChan...
)

Builds a channel gain matrix for a non-spatialized source. The non-static variation of this function queries AudioMixerDevice->NumOutputChannels directly which may not be thread safe.

Public function Static

void

 

Get2DChannelMap

(
    bool bIsVorbis,
    const int32 NumSourceChannels,
    const int32 NumOutputChannels,
    const bool bIsCenterChannelOnly,
    Audio::AlignedFloatBuffer& OutChan...
)

Builds a channel gain matrix for a non-spatialized source. The non-static variation of this function queries AudioMixerDevice->NumOutputChannels directly which may not be thread safe.

Public function

void

 

Get3DChannelMap

(
    const int32 InSubmixNumChannels,
    const FWaveInstance* InWaveIns...,
    const float EmitterAzimuth,
    const float NormalizedOmniRadius,
    Audio::AlignedFloatBuffer& OutChan...
)

Builds a 3D channel map for a spatialized source.

Public function Const

double

 

GetAudioClockDelta()

Public function Const

IAudioMixerP...

 

GetAudioMixerPlatform()

Retrieve a pointer to the currently active platform. Only use this if you know what you are doing. The returned IAudioMixerPlatformInterface will only be alive as long as this FMixerDevice is alive.

Public function Const

double

 

GetAudioRenderThreadTime()

Public function Const

double

 

GetAudioThreadTime()

Audio thread tick timing relative to audio render thread timing.

Public function

FMixerSubmix...

 

GetBaseDefaultSubmix()

Public function Const

const TArray...

 

GetChannelArray()

Returns the channel array for the given submix channel type.

Public function Const

const FChann...

 

GetDefaultChannelPositions()

Retrieves spherical locations of channels for a given submix format.

Public function

TArray< Audi...

 

GetDefaultPositionMap

(
    int32 NumChannels
)

Public function Const

int32

 

GetDeviceOutputChannels()

Public function Const

int32

 

GetDeviceSampleRate()

Public function

ISoundfieldF...

 

GetFactoryForSubmixInstance

(
    USoundSubmix* SoundSubmix
)

If SoundSubmix is a soundfield submix, this will return the factory used to encode source audio to it's soundfield format.

Public function

ISoundfieldF...

 

GetFactoryForSubmixInstance

(
    FMixerSubmixWeakPtr& SoundSubmixPt...
)

If SoundSubmix is a soundfield submix, this will return the factory used to encode source audio to it's soundfield format.

Public function

const TArray...

 

GetListenerTransforms()

Retrieves the listener transforms.

Public function

FMixerSubmix...

 

GetMasterEQSubmix()

Public function

FMixerSubmix...

 

GetMasterReverbSubmix()

Public function

FMixerSubmix...

 

GetMasterSubmix()

Public function

FMixerSource...

 

GetMixerSourceVoice()

Public Functions.

Public function Const

EMonoChannel...

 

GetMonoChannelUpmixMethod()

Public function Const

int32

 

GetNumDeviceChannels()

Public function Const

int32

 

GetNumOutputFrames()

Public function Const

int32

 

GetNumSources()

Public function Const

const FAudio...

 

GetPlatformDeviceInfo()

Public function

FMixerSource...

 

GetSourceManager()

Public function

FMixerSubmix...

 

GetSubmixInstance

(
    const USoundSubmixBase* SoundS...
)

Public function

bool

 

IsAudioBusActive

(
    uint32 InAudioBusId
)

Public function Const

bool

 

IsAudioRenderingThread()

Public function Static

bool

 

IsEndpointSubmix

(
    const USoundSubmixBase* InSubm...
)

Public function Virtual

void

 

PauseRecording

(
    USoundSubmix* InSubmix
)

Public function

void

 

ReleaseMixerSourceVoice

(
    FMixerSourceVoice* InSourceVoi...
)

Public function

void

 

RemoveMasterSubmixEffect

(
    uint32 SubmixEffectId
)

Remove submix effect from master submix.

Public function

void

 

RemoveSubmixEffect

(
    USoundSubmix* InSoundSubmix,
    uint32 SubmixEffectId
)

Remove submix effect to given submix.

Public function

void

 

RemoveSubmixEffectAtIndex

(
    USoundSubmix* InSoundSubmix,
    int32 SubmixChainIndex
)

Remove submix effect at the given submix chain index.

Public function

void

 

ReplaceSoundEffectSubmix

(
    USoundSubmix* InSoundSubmix,
    int32 InSubmixChainIndex,
    FSoundEffectSubmixPtr SoundEffect
)

Replace the submix effect of the given submix at the submix chain index with the new submix effect id and submix instance.

Public function Virtual

void

 

ResumeRecording

(
    USoundSubmix* InSubmix
)

Public function

void

 

StartAudioBus

(
    uint32 InAudioBusId,
    int32 InNumChannels,
    bool bInIsAutomatic
)

Audio bus API.

Public function

void

 

StopAudioBus

(
    uint32 InAudioBusId
)

Overridden from FAudioDevice

Name Description

Public function Virtual

void

 

AddEnvelopeFollowerDelegate

(
    USoundSubmix* InSubmix,
    const FOnSubmixEnvelopeBP& OnSubmi...
)

Adds an envelope follower delegate to the submix for this audio device.

Public function Virtual

FPatchOutput...

 

AddPatchForSubmix

(
    uint32 InObjectId,
    float InPatchGain
)

Public function Virtual

void

 

AddSpectralAnalysisDelegate

(
    USoundSubmix* InSubmix,
    const FSoundSpectrumAnalyzerDelegat...,
    const FOnSubmixSpectralAnalysisBP&...
)

Public function Virtual

void

 

ClearSubmixEffectChainOverride

(
    USoundSubmix* InSoundSubmix,
    float InCrossfadeTime
)

Clears all submix effect chain overrides from the submix.

Public function Virtual

void

 

CountBytes

(
    FArchive& Ar
)

Counts the bytes for the structures used in this class

Public function Virtual

ICompressedA...

 

CreateCompressedAudioInfo

(
    USoundWave* SoundWave
)

Creates a Compressed audio info class suitable for decompressing this SoundWave

Public function Virtual

FAudioEffect...

 

CreateEffectsManager()

Creates a new platform specific sound source

Public function Virtual

FSoundSource...

 

CreateSoundSource()

Creates a new platform specific sound source

Public function Virtual Const

bool

 

DisablePCMAudioCaching()

Whether or not the platform disables caching of decompressed PCM data (i.e. to save memory on fixed memory platforms

Public function Virtual

void

 

EnableDebugAudioOutput()

Enables the audio device to output debug audio to test audio device output.

Public function Virtual

void

 

FadeIn()

Public function Virtual

void

 

FadeOut()

Optional fadeout and fade in of audio to avoid clicks when closing or opening/reusing audio device.

Public function Virtual

void

 

FlushAudioRenderingCommands

(
    bool bPumpSynchronously
)

Allows audio rendering command queue to flush during audio device flush.

Public function Virtual

void

 

FlushExtended

(
    UWorld* WorldToFlush,
    bool bClearActivatedReverb
)

Derived classes can override this method to do their own cleanup.

Public function Virtual Const

void

 

GetAudioDeviceList

(
    TArray< FString >& OutAudioDeviceN...
)

Returns an array of available audio devices names for the platform

Public function Virtual Const

double

 

GetAudioTime()

Return the audio stream time

Public function Virtual

bool

 

GetCurrentSourceEffectChain

(
    const uint32 SourceEffectChainId,
    TArray< FSourceEffectChainEntry >&...
)

Returns the current source effect chain entries set dynamically from BP or elsewhere.

Public function Virtual

void

 

GetMagnitudesForFrequencies

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

Public function Virtual Const

int32

 

GetNumActiveSources()

Returns the number of active sound sources

Public function Virtual

void

 

GetPhasesForFrequencies

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

Public function Virtual Const

FAudioPlatfo...

 

GetPlatformSettings()

Allow platforms to optionally specify low-level audio platform settings.

Public function Virtual

FName

 

GetRuntimeFormat

(
    USoundWave* SoundWave
)

Public function Virtual

bool

 

HasCompressedAudioInfoClass

(
    USoundWave* SoundWave
)

Whether this SoundWave has an associated info class to decompress it

Public function Virtual

void

 

InitDefaultAudioBuses()

Initialized audio buses marked as default that are to be enabled for the duration of the application.

Public function Virtual

bool

 

InitializeHardware()

Starts up any platform specific hardware/APIs

Public function Virtual

void

 

InitSoundEffectPresets()

Protected function Virtual

void

 

InitSoundSubmixes()

Initializes sound submixes.

Public function Virtual

bool

 

IsExernalBackgroundSoundActive()

Check if any background music or sound is playing through the audio device

Public function Virtual Const

bool

 

IsNonRealtime()

Audio Device Properties.

Protected function Virtual

void

 

OnListenerUpdated

(
    const TArray< FListener >& InListe...
)

This is overridden in Audio::FMixerDevice to propogate listener information to the audio thread.

Public function Virtual

void

 

RegisterSoundSubmix

(
    USoundSubmixBase* SoundSubmix,
    bool bInit
)

Registers the sound submix

Public function Virtual

void

 

RegisterSubmixBufferListener

(
    ISubmixBufferListener* InSubmi...,
    USoundSubmix* InSubmix
)

Submix buffer listener callbacks.

Public function Virtual

void

 

RemoveSpectralAnalysisDelegate

(
    USoundSubmix* InSubmix,
    const FOnSubmixSpectralAnalysisBP&...
)

Public function Virtual

void

 

ResumeContext()

Resume any context related objects

Public function Virtual

void

 

SetSubmixDryLevel

(
    USoundSubmix* InSoundSubmix,
    float InDryLevel
)

Set the wet-dry level of the given submix

Public function Virtual

void

 

SetSubmixEffectChainOverride

(
    USoundSubmix* InSoundSubmix,
    const TArray< FSoundEffectSubmixPtr...,
    float InFadeTimeSec
)

Submix effect chain override settings.

Public function Virtual

void

 

SetSubmixOutputVolume

(
    USoundSubmix* InSoundSubmix,
    float InOutputVolume
)

Set the wet-dry level of the given submix

Public function Virtual

void

 

SetSubmixWetDryLevel

(
    USoundSubmix* InSoundSubmix,
    float InOutputVolume,
    float InWetLevel,
    float InDryLevel
)

Set the wet-dry level of the given submix

Public function Virtual

void

 

SetSubmixWetLevel

(
    USoundSubmix* InSoundSubmix,
    float InWetLevel
)

Set the wet-dry level of the given submix

Public function Virtual

void

 

ShutdownDefaultAudioBuses()

Shutdown all audio buses marked as default.

Public function Virtual

void

 

StartEnvelopeFollowing

(
    USoundSubmix* InSubmix
)

Submix envelope following.

Public function Virtual

void

 

StartRecording

(
    USoundSubmix* InSubmix,
    float ExpectedRecordingDuration
)

Submix recording callbacks:

Public function Virtual

void

 

StartSpectrumAnalysis

(
    USoundSubmix* InSubmix,
    const FSoundSpectrumAnalyzerSetting...
)

Submix Spectrum Analysis.

Public function Virtual

void

 

StopEnvelopeFollowing

(
    USoundSubmix* InSubmix
)

This is called by a USoundSubmix when we stop envelope following a submix instance on this device.

Public function Virtual

Audio::Align...

 

StopRecording

(
    USoundSubmix* InSubmix,
    float& OutNumChannels,
    float& OutSampleRate
)

This is called by a USoundSubmix when we stop recording a submix on this device.

Public function Virtual

void

 

StopSpectrumAnalysis

(
    USoundSubmix* InSubmix
)

Public function Virtual Const

bool

 

SupportsRealtimeDecompression()

Whether this device supports realtime decompression of sound waves (i.e. DTYPE_RealTime)

Public function Virtual

void

 

SuspendContext()

Suspend any context related objects

Public function Virtual

void

 

TeardownHardware()

Shuts down any platform specific hardware/APIs

Public function Virtual

void

 

UnregisterSoundSubmix

(
    const USoundSubmixBase* SoundS...
)

Unregisters the sound submix

Public function Virtual

void

 

UnregisterSubmixBufferListener

(
    ISubmixBufferListener* InSubmi...,
    USoundSubmix* SoundSubmix
)

Unregisters the submix buffer listener with the given submix.

Public function Virtual

void

 

UpdateDeviceDeltaTime()

Sets the update delta time for the audio frame

Public function Virtual

void

 

UpdateGameThread()

Update called on game thread.

Public function Virtual

void

 

UpdateHardware()

Lets the platform any tick actions

Public function Virtual

void

 

UpdateHardwareTiming()

Updates timing information for hardware.

Public function Virtual

void

 

UpdateSourceEffectChain

(
    const uint32 SourceEffectChainId,
    const TArray< FSourceEffectChainEnt...,
    const bool bPlayEffectChainTails
)

Updates the source effect chain (using unique object id).

Public function Virtual

void

 

UpdateSubmixProperties

(
    USoundSubmixBase* InSubmix
)

Submix dry/wet settings.

Public function Virtual

bool

 

ValidateAPICall

(
    const TCHAR* Function,
    uint32 ErrorCode
)

Check for errors and output a human readable string

Overridden from FExec

Name Description

Public function Virtual

bool

 

Exec

(
    UWorld* InWorld,
    const TCHAR* Cmd,
    FOutputDevice& Ar
)

Exec handler

Overridden from IAudioMixer

Name Description

Public function Virtual

void

 

OnAudioStreamShutdown()

Called when audio render thread stream is shutting down.

Public function Virtual

bool

 

OnProcessAudioStream

(
    AlignedFloatBuffer& OutputBuffer
)

Callback to generate a new audio stream buffer.

Overridden from FGCObject

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Pure virtual that must be overloaded by the inheriting class.

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