UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAudioDeviceManager Class Reference

#include <AudioDeviceManager.h>

Public Member Functions

ENGINE_API FAudioDeviceManager ()
 
ENGINE_API ~FAudioDeviceManager ()
 
const FAudioDeviceHandleGetMainAudioDeviceHandle () const
 
FAudioDeviceGetMainAudioDeviceRaw () const
 
Audio::FDeviceId GetMainAudioDeviceID () const
 
ENGINE_API IAudioDeviceModuleGetAudioDeviceModule ()
 
ENGINE_API FAudioDeviceParams GetDefaultParamsForNewWorld ()
 
ENGINE_API FAudioDeviceHandle RequestAudioDevice (const FAudioDeviceParams &InParams)
 
ENGINE_API bool IsValidAudioDevice (Audio::FDeviceId DeviceID) const
 
ENGINE_API FAudioDeviceHandle GetAudioDevice (Audio::FDeviceId InDeviceID)
 
ENGINE_API FAudioDeviceGetAudioDeviceRaw (Audio::FDeviceId InDeviceID)
 
ENGINE_API const FAudioDeviceGetAudioDeviceRaw (Audio::FDeviceId InDeviceID) const
 
ENGINE_API void SetAudioDevice (UWorld &InWorld, Audio::FDeviceId InDeviceID)
 
ENGINE_API bool CreateMainAudioDevice ()
 
ENGINE_API FAudioDeviceHandle GetActiveAudioDevice ()
 
ENGINE_API uint8 GetNumActiveAudioDevices () const
 
ENGINE_API uint8 GetNumMainAudioDeviceWorlds () const
 
ENGINE_API void UpdateActiveAudioDevices (bool bGameTicking)
 
ENGINE_API void IterateOverAllDevices (TUniqueFunction< void(Audio::FDeviceId, FAudioDevice *)> ForEachDevice)
 
ENGINE_API void IterateOverAllDevices (TUniqueFunction< void(Audio::FDeviceId, const FAudioDevice *)> ForEachDevice) const
 
ENGINE_API void AddReferencedObjects (FReferenceCollector &Collector)
 
ENGINE_API void StopSoundsUsingResource (class USoundWave *InSoundWave, TArray< UAudioComponent * > *StoppedComponents=nullptr)
 
ENGINE_API void RegisterSoundClass (USoundClass *SoundClass)
 
ENGINE_API void UnregisterSoundClass (USoundClass *SoundClass)
 
ENGINE_API void RegisterWorld (UWorld *InWorld, Audio::FDeviceId DeviceId)
 
ENGINE_API void UnregisterWorld (UWorld *InWorld, Audio::FDeviceId DeviceId)
 
ENGINE_API void InitSoundClasses ()
 
ENGINE_API void RegisterSoundSubmix (USoundSubmixBase *SoundSubmix)
 
ENGINE_API void UnregisterSoundSubmix (const USoundSubmixBase *SoundSubmix)
 
ENGINE_API void InitSoundSubmixes ()
 
ENGINE_API void InitSoundEffectPresets ()
 
ENGINE_API void UpdateSourceEffectChain (const uint32 SourceEffectChainId, const TArray< FSourceEffectChainEntry > &SourceEffectChain, const bool bPlayEffectChainTails)
 
ENGINE_API void UpdateSubmix (USoundSubmixBase *SoundSubmix)
 
ENGINE_API void SetActiveDevice (uint32 InAudioDeviceHandle)
 
ENGINE_API void SetSoloDevice (Audio::FDeviceId InAudioDeviceHandle)
 
ENGINE_API void TrackResource (USoundWave *SoundWave, FSoundBuffer *Buffer)
 
ENGINE_API void FreeResource (USoundWave *SoundWave)
 
ENGINE_API void FreeBufferResource (FSoundBuffer *SoundBuffer)
 
ENGINE_API void StopSourcesUsingBuffer (FSoundBuffer *Buffer)
 
ENGINE_API FSoundBufferGetSoundBufferForResourceID (uint32 ResourceID)
 
ENGINE_API void RemoveSoundBufferForResourceID (uint32 ResourceID)
 
ENGINE_API void RemoveSoundMix (USoundMix *SoundMix)
 
ENGINE_API void TogglePlayAllDeviceAudio ()
 
bool IsPlayAllDeviceAudio () const
 
ENGINE_API bool IsAlwaysPlayNonRealtimeDeviceAudio () const
 
ENGINE_API bool IsVisualizeDebug3dEnabled () const
 
ENGINE_API void ToggleVisualize3dDebug ()
 
ENGINE_API void ResetAllDynamicSoundVolumes ()
 
ENGINE_API float GetDynamicSoundVolume (ESoundType SoundType, const FName &SoundName) const
 
ENGINE_API void ResetDynamicSoundVolume (ESoundType SoundType, const FName &SoundName)
 
ENGINE_API void SetDynamicSoundVolume (ESoundType SoundType, const FName &SoundName, float Volume)
 
ENGINE_API TArray< FAudioDevice * > GetAudioDevices () const
 
ENGINE_API TArray< UWorld * > GetWorldsUsingAudioDevice (const Audio::FDeviceId &InID) const
 
ENGINE_API void LogListOfAudioDevices ()
 
ENGINE_API Audio::FAudioFormatSettingsGetAudioFormatSettings () const
 

Static Public Member Functions

static ENGINE_API FAudioDeviceGetAudioDeviceFromWorldContext (const UObject *WorldContextObject)
 
static ENGINE_API Audio::FMixerDeviceGetAudioMixerDeviceFromWorldContext (const UObject *WorldContextObject)
 
static ENGINE_API bool PreInitialize ()
 
static ENGINE_API bool Initialize ()
 
static ENGINE_API FAudioDeviceManagerGet ()
 
static ENGINE_API void Shutdown ()
 
static ENGINE_API void EnableAggregateDeviceSupport (const bool bInEnableAggregateDevice)
 
static ENGINE_API bool IsAggregateDeviceSupportEnabled ()
 

Public Attributes

TArray< FSoundBuffer * > Buffers
 
TMap< int32, FSoundBuffer * > WaveBufferMap
 

Friends

class FAudioDeviceHandle
 

Detailed Description

Class for managing multiple audio devices.

Constructor & Destructor Documentation

◆ FAudioDeviceManager()

FAudioDeviceManager::FAudioDeviceManager ( )

Constructor

◆ ~FAudioDeviceManager()

PRAGMA_DISABLE_DEPRECATION_WARNINGS FAudioDeviceManager::~FAudioDeviceManager ( )

Destructor

Member Function Documentation

◆ AddReferencedObjects()

void FAudioDeviceManager::AddReferencedObjects ( FReferenceCollector Collector)

Tracks objects in the active audio devices.

◆ CreateMainAudioDevice()

bool FAudioDeviceManager::CreateMainAudioDevice ( )

Creates the main audio device.

◆ EnableAggregateDeviceSupport()

void FAudioDeviceManager::EnableAggregateDeviceSupport ( const bool  bInEnableAggregateDevice)
static

◆ FreeBufferResource()

void FAudioDeviceManager::FreeBufferResource ( FSoundBuffer SoundBuffer)

◆ FreeResource()

void FAudioDeviceManager::FreeResource ( USoundWave SoundWave)

Frees the given sound wave resource from the device manager

◆ Get()

FAudioDeviceManager * FAudioDeviceManager::Get ( )
static

Returns the AudioDeviceManager Singleton

Returns
The Instance instance or nullptr if the device has not been fully initialized.

◆ GetActiveAudioDevice()

FAudioDeviceHandle FAudioDeviceManager::GetActiveAudioDevice ( )

Returns a ptr to the active audio device. If there is no active device then it will return the main audio device.

◆ GetAudioDevice()

FAudioDeviceHandle FAudioDeviceManager::GetAudioDevice ( Audio::FDeviceId  InDeviceID)

Returns a strong handle to the audio device associated with the given device ID. if the device ID is invalid returns an invalid, zeroed handle.

◆ GetAudioDeviceFromWorldContext()

PRAGMA_ENABLE_DEPRECATION_WARNINGS FAudioDevice * FAudioDeviceManager::GetAudioDeviceFromWorldContext ( const UObject WorldContextObject)
static

◆ GetAudioDeviceModule()

IAudioDeviceModule * FAudioDeviceManager::GetAudioDeviceModule ( )

returns the currently used audio device module for this platform. returns nullptr if Initialize() has not been called yet.

◆ GetAudioDeviceRaw() [1/2]

FAudioDevice * FAudioDeviceManager::GetAudioDeviceRaw ( Audio::FDeviceId  InDeviceID)

Returns a raw ptr to the audio device associated with the handle. If the handle is invalid then a NULL device ptr will be returned.

◆ GetAudioDeviceRaw() [2/2]

const FAudioDevice * FAudioDeviceManager::GetAudioDeviceRaw ( Audio::FDeviceId  InDeviceID) const

◆ GetAudioDevices()

TArray< FAudioDevice * > FAudioDeviceManager::GetAudioDevices ( ) const

Returns all the audio devices managed by device manager.

◆ GetAudioFormatSettings()

Audio::FAudioFormatSettings & FAudioDeviceManager::GetAudioFormatSettings ( ) const

◆ GetAudioMixerDeviceFromWorldContext()

Audio::FMixerDevice * FAudioDeviceManager::GetAudioMixerDeviceFromWorldContext ( const UObject WorldContextObject)
static

◆ GetDefaultParamsForNewWorld()

FAudioDeviceParams FAudioDeviceManager::GetDefaultParamsForNewWorld ( )

◆ GetDynamicSoundVolume()

float FAudioDeviceManager::GetDynamicSoundVolume ( ESoundType  SoundType,
const FName SoundName 
) const

Get, reset, or set a sound cue trim

◆ GetMainAudioDeviceHandle()

const FAudioDeviceHandle & FAudioDeviceManager::GetMainAudioDeviceHandle ( ) const
inline

Returns the handle to the main audio device.

◆ GetMainAudioDeviceID()

Audio::FDeviceId FAudioDeviceManager::GetMainAudioDeviceID ( ) const
inline

◆ GetMainAudioDeviceRaw()

FAudioDevice * FAudioDeviceManager::GetMainAudioDeviceRaw ( ) const
inline

◆ GetNumActiveAudioDevices()

uint8 FAudioDeviceManager::GetNumActiveAudioDevices ( ) const

Returns the current number of active audio devices.

◆ GetNumMainAudioDeviceWorlds()

uint8 FAudioDeviceManager::GetNumMainAudioDeviceWorlds ( ) const

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

◆ GetSoundBufferForResourceID()

FSoundBuffer * FAudioDeviceManager::GetSoundBufferForResourceID ( uint32  ResourceID)

◆ GetWorldsUsingAudioDevice()

TArray< UWorld * > FAudioDeviceManager::GetWorldsUsingAudioDevice ( const Audio::FDeviceId InID) const

◆ Initialize()

bool FAudioDeviceManager::Initialize ( )
static

Initializes the Manager. NOTE: If the manager hasn't been PreInitialized, that stage will be performed first.

Returns
True if success, false otherwise

◆ InitSoundClasses()

void FAudioDeviceManager::InitSoundClasses ( )

Initializes the sound class for all active devices.

◆ InitSoundEffectPresets()

void FAudioDeviceManager::InitSoundEffectPresets ( )

Initialize all sound effect presets.

◆ InitSoundSubmixes()

void FAudioDeviceManager::InitSoundSubmixes ( )

Initializes the sound mixes for all active devices.

◆ IsAggregateDeviceSupportEnabled()

bool FAudioDeviceManager::IsAggregateDeviceSupportEnabled ( )
static

◆ IsAlwaysPlayNonRealtimeDeviceAudio()

bool FAudioDeviceManager::IsAlwaysPlayNonRealtimeDeviceAudio ( ) const

Gets whether or not non-realtime devices should play their audio.

◆ IsPlayAllDeviceAudio()

bool FAudioDeviceManager::IsPlayAllDeviceAudio ( ) const
inline

Gets whether or not all devices should play their audio.

◆ IsValidAudioDevice()

bool FAudioDeviceManager::IsValidAudioDevice ( Audio::FDeviceId  DeviceID) const

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

◆ IsVisualizeDebug3dEnabled()

bool FAudioDeviceManager::IsVisualizeDebug3dEnabled ( ) const

Is debug visualization of 3d sounds enabled

◆ IterateOverAllDevices() [1/2]

void FAudioDeviceManager::IterateOverAllDevices ( TUniqueFunction< void(Audio::FDeviceId, const FAudioDevice *)>  ForEachDevice) const

◆ IterateOverAllDevices() [2/2]

void FAudioDeviceManager::IterateOverAllDevices ( TUniqueFunction< void(Audio::FDeviceId, FAudioDevice *)>  ForEachDevice)

Iterates over all managed audio devices

◆ LogListOfAudioDevices()

void FAudioDeviceManager::LogListOfAudioDevices ( )

◆ PreInitialize()

bool FAudioDeviceManager::PreInitialize ( )
static

Pre-initializes the Manager. This starts up and initializes the manager early without need for the Engine to be available, so that we can load essential services ahead of Engine Startup.

Returns
True if success, false otherwise

◆ RegisterSoundClass()

void FAudioDeviceManager::RegisterSoundClass ( USoundClass SoundClass)

Registers the Sound Class for all active devices.

◆ RegisterSoundSubmix()

void FAudioDeviceManager::RegisterSoundSubmix ( USoundSubmixBase SoundSubmix)

Registers the Sound Mix for all active devices.

◆ RegisterWorld()

void FAudioDeviceManager::RegisterWorld ( UWorld InWorld,
Audio::FDeviceId  DeviceId 
)

Registers the world with the provided device Id

◆ RemoveSoundBufferForResourceID()

void FAudioDeviceManager::RemoveSoundBufferForResourceID ( uint32  ResourceID)

Removes the sound buffer for the given resource id

◆ RemoveSoundMix()

void FAudioDeviceManager::RemoveSoundMix ( USoundMix SoundMix)

Removes sound mix from all audio devices

◆ RequestAudioDevice()

FAudioDeviceHandle FAudioDeviceManager::RequestAudioDevice ( const FAudioDeviceParams InParams)

Creates or requests an audio device instance internally and returns a handle to the audio device. This audio device is guaranteed to be alive as long as the returned handle is in scope.

◆ ResetAllDynamicSoundVolumes()

void FAudioDeviceManager::ResetAllDynamicSoundVolumes ( )

Reset all sound cue trims

◆ ResetDynamicSoundVolume()

void FAudioDeviceManager::ResetDynamicSoundVolume ( ESoundType  SoundType,
const FName SoundName 
)

◆ SetActiveDevice()

void FAudioDeviceManager::SetActiveDevice ( uint32  InAudioDeviceHandle)

Sets which audio device is the active audio device.

◆ SetAudioDevice()

void FAudioDeviceManager::SetAudioDevice ( UWorld InWorld,
Audio::FDeviceId  InDeviceID 
)

Sets the device associated with the given world.

◆ SetDynamicSoundVolume()

void FAudioDeviceManager::SetDynamicSoundVolume ( ESoundType  SoundType,
const FName SoundName,
float  Volume 
)

◆ SetSoloDevice()

void FAudioDeviceManager::SetSoloDevice ( Audio::FDeviceId  InAudioDeviceHandle)

Sets an audio device to be solo'd

◆ Shutdown()

void FAudioDeviceManager::Shutdown ( )
static

Shuts down the AudioDeviceManager and all AudioDevices.

◆ StopSoundsUsingResource()

void FAudioDeviceManager::StopSoundsUsingResource ( class USoundWave InSoundWave,
TArray< UAudioComponent * > *  StoppedComponents = nullptr 
)

Stops sounds using the given resource on all audio devices.

◆ StopSourcesUsingBuffer()

void FAudioDeviceManager::StopSourcesUsingBuffer ( FSoundBuffer Buffer)

◆ TogglePlayAllDeviceAudio()

void FAudioDeviceManager::TogglePlayAllDeviceAudio ( )

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

◆ ToggleVisualize3dDebug()

void FAudioDeviceManager::ToggleVisualize3dDebug ( )

Toggles 3d visualization of 3d sounds on/off

◆ TrackResource()

void FAudioDeviceManager::TrackResource ( USoundWave SoundWave,
FSoundBuffer Buffer 
)

◆ UnregisterSoundClass()

void FAudioDeviceManager::UnregisterSoundClass ( USoundClass SoundClass)

Unregisters the Sound Class for all active devices.

◆ UnregisterSoundSubmix()

void FAudioDeviceManager::UnregisterSoundSubmix ( const USoundSubmixBase SoundSubmix)

Registers the Sound Mix for all active devices.

◆ UnregisterWorld()

void FAudioDeviceManager::UnregisterWorld ( UWorld InWorld,
Audio::FDeviceId  DeviceId 
)

Unregisters the world from the provided device Id

◆ UpdateActiveAudioDevices()

void FAudioDeviceManager::UpdateActiveAudioDevices ( bool  bGameTicking)

Updates all active audio devices

◆ UpdateSourceEffectChain()

void FAudioDeviceManager::UpdateSourceEffectChain ( const uint32  SourceEffectChainId,
const TArray< FSourceEffectChainEntry > &  SourceEffectChain,
const bool  bPlayEffectChainTails 
)

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

◆ UpdateSubmix()

void FAudioDeviceManager::UpdateSubmix ( USoundSubmixBase SoundSubmix)

Updates this submix for any changes made. Broadcasts to all submix instances.

Friends And Related Symbol Documentation

◆ FAudioDeviceHandle

friend class FAudioDeviceHandle
friend

Member Data Documentation

◆ Buffers

TArray<FSoundBuffer*> FAudioDeviceManager::Buffers

Array of all created buffers

◆ WaveBufferMap

TMap<int32, FSoundBuffer*> FAudioDeviceManager::WaveBufferMap

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


The documentation for this class was generated from the following files: