FAudioDeviceManager

Class for managing multiple audio devices.

Windows
MacOS
Linux

Syntax

class FAudioDeviceManager

Remarks

Class for managing multiple audio devices.

Variables

Name Description

Public variable

TArray< FSoundB...

 

Buffers

Array of all created buffers

Public variable

TMap< int32, FS...

 

WaveBufferMap

Look up associating a USoundWave's resource ID with sound buffers

Constructors

Name Description

Public function

FAudioDeviceManager()

Constructor

Destructors

Name Description

Public function

~FAudioDeviceManager()

Destructor

Functions

Name Description

Public function

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Tracks objects in the active audio devices.

Public function

bool

 

CreateAudioDevice

(
    bool bCreateNewDevice,
    FCreateAudioDeviceResults& OutResu...
)

Creates and audio device instance internally and returns a handle to the audio device.

Public function

void

 

FreeBufferResource

(
    FSoundBuffer* SoundBuffer
)

Frees the sound buffer from the device manager.

Public function

void

 

FreeResource

(
    USoundWave* SoundWave
)

Frees the given sound wave resource from the device manager

Public function

FAudioDevice...

 

GetActiveAudioDevice()

Returns a ptr to the active audio device.

Public function

bool

 

GetAudioDebugSound

(
    FString& OutDebugSound
)

Gets the debug sound string, returns true if one has been set.

Public function

FAudioDevice...

 

GetAudioDevice

(
    uint32 Handle
)

Returns a ptr to the audio device associated with the handle.

Public function

TArray< FAud...

 

GetAudioDevices()

Returns all the audio devices managed by device manager.

Public function Const

const FStrin...

 

GetAudioMixerDebugSoundName()

Gets the audio mixer debug sound name.

Public function Const

const FStrin...

 

GetDebugSoloSoundClass()

Gets the solo sound class used for debugging sounds

Public function Const

const FStrin...

 

GetDebugSoloSoundCue()

Gets the solo sound name used for debugging sound cues

Public function Const

const FStrin...

 

GetDebugSoloSoundWave()

Gets the solo sound name used for debugging sound waves

Public function Const

float

 

GetDynamicSoundVolume

(
    ESoundType SoundType,
    const FName& SoundName
)

Get, reset, or set a sound cue trim

Public function Const

uint32

 

GetMainAudioDeviceHandle()

Returns the handle to the main audio device.

Public function Const

uint8

 

GetNumActiveAudioDevices()

Returns the current number of active audio devices.

Public function Const

uint8

 

GetNumMainAudioDeviceWorlds()

Returns the number of worlds (e.g. PIE viewports) using the main audio device.

Public function

FSoundBuffer...

 

GetSoundBufferForResourceID

(
    uint32 ResourceID
)

Retrieves the sound buffer for the given resource id

Public function

bool

 

Initialize()

Initialize the audio device manager. Return true if successfully initialized.

Public function

void

 

InitSoundClasses()

Initializes the sound class for all active devices.

Public function

void

 

InitSoundEffectPresets()

Initialize all sound effect presets.

Public function

void

 

InitSoundSubmixes()

Initializes the sound mixes for all active devices.

Public function Const

bool

 

IsPlayAllDeviceAudio()

Gets whether or not all devices should play their audio.

Public function Const

bool

 

IsUsingAudioMixer()

Returns true if we're currently using the audio mixer.

Public function Const

bool

 

IsValidAudioDeviceHandle

(
    uint32 Handle
)

Returns whether the audio device handle is valid (i.e. points to an actual audio device instance)

Public function Const

bool

 

IsVisualizeDebug3dEnabled()

Is debug visualization of 3d sounds enabled

Public function

void

 

RegisterSoundClass

(
    USoundClass* SoundClass
)

Registers the Sound Class for all active devices.

Public function

void

 

RegisterSoundSubmix

(
    USoundSubmix* SoundSubmix
)

Registers the Sound Mix for all active devices.

Public function

void

 

RemoveSoundBufferForResourceID

(
    uint32 ResourceID
)

Removes the sound buffer for the given resource id

Public function

void

 

RemoveSoundMix

(
    USoundMix* SoundMix
)

Removes sound mix from all audio devices

Public function

void

 

ResetAllDynamicSoundVolumes()

Reset all sound cue trims

Public function

void

 

ResetDynamicSoundVolume

(
    ESoundType SoundType,
    const FName& SoundName
)

Public function

void

 

SetActiveDevice

(
    uint32 InAudioDeviceHandle
)

Sets which audio device is the active audio device.

Public function

void

 

SetAudioDebugSound

(
    const TCHAR* SoundName
)

Public function

void

 

SetAudioMixerDebugSound

(
    const TCHAR* SoundName
)

Enables debug logging and soloing of sounds that substring match the given sound name.

Public function

void

 

SetDebugSoloSoundClass

(
    const TCHAR* SoundClassName
)

Debug solos the given sound class name. Sounds that play with this sound class will be solo'd

Public function

void

 

SetDebugSoloSoundCue

(
    const TCHAR* SoundClassName
)

Public function

void

 

SetDebugSoloSoundWave

(
    const TCHAR* SoundClassName
)

Debug solos the given sound name. Sounds that play with this name will be solo'd

Public function

void

 

SetDynamicSoundVolume

(
    ESoundType SoundType,
    const FName& SoundName,
    float Volume
)

Public function

void

 

SetSoloDevice

(
    uint32 InAudioDeviceHandle
)

Sets an audio device to be solo'd

Public function

bool

 

ShutdownAllAudioDevices()

Shuts down all active audio devices

Public function

bool

 

ShutdownAudioDevice

(
    uint32 Handle
)

Shutsdown the audio device associated with the handle.

Public function

void

 

StopSoundsUsingResource

(
    USoundWave* InSoundWave,
    TArray< UAudioComponent* >...
)

Stops sounds using the given resource on all audio devices.

Public function

void

 

StopSourcesUsingBuffer

(
    FSoundBuffer* Buffer
)

Stops using the given sound buffer. Called before freeing the buffer

Public function

void

 

ToggleDebugStat

(
    const uint8 StatBitMask
)

Toggles the given debug stat bitmask for all current audio devices.

Public function

void

 

TogglePlayAllDeviceAudio()

Toggles playing audio for all active PIE sessions (and all devices).

Public function

void

 

ToggleVisualize3dDebug()

Toggles 3d visualization of 3d sounds on/off

Public function

void

 

TrackResource

(
    USoundWave* SoundWave,
    FSoundBuffer* Buffer
)

Links up the resource data indices for looking up and cleaning up.

Public function

void

 

UnregisterSoundClass

(
    USoundClass* SoundClass
)

Unregisters the Sound Class for all active devices.

Public function

void

 

UnregisterSoundSubmix

(
    USoundSubmix* SoundSubmix
)

Registers the Sound Mix for all active devices.

Public function

void

 

UpdateActiveAudioDevices

(
    bool bGameTicking
)

Updates all active audio devices

Public function

void

 

UpdateSourceEffectChain

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

Updates source effect chain on all sources currently using the source effect chain.

Classes

Name

Description

Public struct

FCreateAudioDeviceResults

References

Module

Engine

Header

Runtime/Engine/Public/AudioDeviceManager.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback