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

Variables

Name Description

Protected variable

TArray< FTransf...

 

ListenerTransforms

Constructors

Name Description

Public function

FMixerDevice

Destructors

Name Description

Public function

~FMixerDevice()

Functions

Name Description

Public function

void

 

AddMasterSubmixEffect

(
    uint32 SubmixEffectId,
    FSoundEffectSubmixPtr SoundEffect
)

Add submix effect to master submix.

Public function

int32

 

AddSubmixEffect

(
    USoundSubmix* InSoundSubmix,
    uint32 SubmixEffectId,
    FSoundEffectSubmixPtr SoundEffect
)

Add submix effect to given submix.

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

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 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,
    int32 SubmixEffectId,
    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
)

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

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

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

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

(
    const USoundSubmixBase* SoundS...,
    bool bInit
)

Registers the sound submix

Public function Virtual

void

 

RegisterSubmixBufferListener

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

Submix buffer listener callbacks.

Public function Virtual

void

 

ResumeContext()

Resume any context related objects

Public function Virtual

void

 

SetSubmixOutputVolume

(
    USoundSubmix* InSubmix,
    float NewVolume
)

Sets the submix output volume dynamically.

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 Audio::FSpectrumAnalyzerSetti...
)

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

 

UpdateModulationControls

(
    const uint32 InSourceId,
    const FSoundModulationControls& In...
)

Updates the provided source's modulation control values.

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
)

Updates submix instances with new properties.

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.

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