Navigation
API > API/Runtime > API/Runtime/Engine
Class for managing multiple audio devices.
| Name | FAudioDeviceManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/AudioDeviceManager.h |
| Include Path | #include "AudioDeviceManager.h" |
Syntax
class FAudioDeviceManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FAudioDeviceManager() |
Constructor | AudioDeviceManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FAudioDeviceManager() |
Destructor | AudioDeviceManager.h |
Structs
| Name | Remarks |
|---|---|
| FAudioDeviceContainer |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| bEnableAggregateDeviceSupport | bool | True if aggregate devices are supported. | AudioDeviceManager.h |
| Singleton | FAudioDeviceManager * | AudioDeviceManager.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Buffers | TArray< FSoundBuffer * > | Array of all created buffers | AudioDeviceManager.h | |
| WaveBufferMap | TMap< int32, FSoundBuffer * > | Look up associating a USoundWave's resource ID with sound buffers | AudioDeviceManager.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActiveAudioDeviceID | Audio::FDeviceId | Which audio device is currently active | AudioDeviceManager.h | |
| AudioDebugger | TUniquePtr< Audio::FAudioDebugger > | Instance of audio debugger shared across audio devices | AudioDeviceManager.h | |
| AudioDeviceModule | IAudioDeviceModule * | Audio device module which creates audio devices. | AudioDeviceManager.h | |
| AudioFormatSettings | TPimplPtr< Audio::FAudioFormatSettings > | AudioDeviceManager.h | ||
| AudioMixerModuleName | FString | The audio mixer module name. This is the audio mixer module name to use. E.g. AudioMixerXAudio2 | AudioDeviceManager.h | |
| bPlayAllDeviceAudio | bool | Whether or not to play all audio in all active audio devices. | AudioDeviceManager.h | |
| DeviceIDCounter | uint32 | Counter used by GetNewDeviceID() to generate a unique ID for a given audio device. | AudioDeviceManager.h | |
| DeviceMapCriticalSection | FCriticalSection | AudioDeviceManager.h | ||
| Devices | TMap< Audio::FDeviceId, FAudioDeviceContainer > | Bank of audio devices. Will increase in size as we create new audio devices, | AudioDeviceManager.h | |
| DynamicSoundVolumes | TMap< TTuple< ESoundType, FName >, float > | Dynamic volume map | AudioDeviceManager.h | |
| EngineFormats | TArray< TPimplPtr< FSimpleAudioInfoFactory > > | AudioDeviceManager.h | ||
| InitPhase | EInitPhase | AudioDeviceManager.h | ||
| MainAudioDeviceHandle | FAudioDeviceHandle | Handle to the main audio device. | AudioDeviceManager.h | |
| NextResourceID | int32 | Next resource ID to assign out to a wave/buffer | AudioDeviceManager.h | |
| SoloDeviceHandle | Audio::FDeviceId | Which audio device is solo'd | AudioDeviceManager.h | |
| SyncFence | FAudioCommandFence | Audio Fence to ensure that we don't allow the audio thread to drift never endingly behind. | AudioDeviceManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddReferencedObjects
(
FReferenceCollector& Collector |
Tracks objects in the active audio devices. | AudioDeviceManager.h | |
bool CreateMainAudioDevice() |
Creates the main audio device. | AudioDeviceManager.h | |
void FreeBufferResource
(
FSoundBuffer* SoundBuffer |
AudioDeviceManager.h | ||
void FreeResource
(
USoundWave* SoundWave |
Frees the given sound wave resource from the device manager | AudioDeviceManager.h | |
| Returns a ptr to the active audio device. | AudioDeviceManager.h | ||
FAudioDeviceHandle GetAudioDevice
(
Audio::FDeviceId InDeviceID |
Returns a strong handle to the audio device associated with the given device ID. | AudioDeviceManager.h | |
| Returns the currently used audio device module for this platform. | AudioDeviceManager.h | ||
const FAudioDevice * GetAudioDeviceRaw
(
Audio::FDeviceId InDeviceID |
AudioDeviceManager.h | ||
FAudioDevice * GetAudioDeviceRaw
(
Audio::FDeviceId InDeviceID |
Returns a raw ptr to the audio device associated with the handle. | AudioDeviceManager.h | |
TArray< FAudioDevice * > GetAudioDevices() |
Returns all the audio devices managed by device manager. | AudioDeviceManager.h | |
Audio::FAudioFormatSettings & GetAudioFormatSettings() |
AudioDeviceManager.h | ||
| Get the audio debugger instance | AudioDeviceManager.h | ||
const Audio::FAudioDebugger & GetDebugger () |
AudioDeviceManager.h | ||
FAudioDeviceParams GetDefaultParamsForNewWorld() |
AudioDeviceManager.h | ||
float GetDynamicSoundVolume
(
ESoundType SoundType, |
Get, reset, or set a sound cue trim | AudioDeviceManager.h | |
const FAudioDeviceHandle & GetMainAudioDeviceHandle() |
Returns the handle to the main audio device. | AudioDeviceManager.h | |
Audio::FDeviceId GetMainAudioDeviceID() |
AudioDeviceManager.h | ||
FAudioDevice * GetMainAudioDeviceRaw() |
AudioDeviceManager.h | ||
uint8 GetNumActiveAudioDevices() |
Returns the current number of active audio devices. | AudioDeviceManager.h | |
uint8 GetNumMainAudioDeviceWorlds() |
Returns the number of worlds (e.g. PIE viewports) using the main audio device. | AudioDeviceManager.h | |
FSoundBuffer * GetSoundBufferForResourceID
(
uint32 ResourceID |
AudioDeviceManager.h | ||
| AudioDeviceManager.h | |||
void InitSoundClasses() |
Initializes the sound class for all active devices. | AudioDeviceManager.h | |
void InitSoundEffectPresets() |
Initialize all sound effect presets. | AudioDeviceManager.h | |
void InitSoundSubmixes() |
Initializes the sound mixes for all active devices. | AudioDeviceManager.h | |
bool IsAlwaysPlayNonRealtimeDeviceAudio() |
Gets whether or not non-realtime devices should play their audio. | AudioDeviceManager.h | |
bool IsPlayAllDeviceAudio() |
Gets whether or not all devices should play their audio. | AudioDeviceManager.h | |
bool IsValidAudioDevice
(
Audio::FDeviceId DeviceID |
Returns whether the audio device handle is valid (i.e. points to an actual audio device instance) | AudioDeviceManager.h | |
bool IsVisualizeDebug3dEnabled() |
Is debug visualization of 3d sounds enabled | AudioDeviceManager.h | |
void IterateOverAllDevices
(
TUniqueFunction< void(Audio::FDeviceId, const FAudioDevice*)> ForEachDevice |
AudioDeviceManager.h | ||
void IterateOverAllDevices
(
TUniqueFunction< void(Audio::FDeviceId, FAudioDevice*)> ForEachDevice |
Iterates over all managed audio devices | AudioDeviceManager.h | |
void LogListOfAudioDevices() |
AudioDeviceManager.h | ||
void RegisterSoundClass
(
USoundClass* SoundClass |
Registers the Sound Class for all active devices. | AudioDeviceManager.h | |
void RegisterSoundSubmix
(
USoundSubmixBase* SoundSubmix |
Registers the Sound Mix for all active devices. | AudioDeviceManager.h | |
void RegisterWorld
(
UWorld* InWorld, |
Registers the world with the provided device Id | AudioDeviceManager.h | |
void RemoveSoundBufferForResourceID
(
uint32 ResourceID |
Removes the sound buffer for the given resource id | AudioDeviceManager.h | |
void RemoveSoundMix
(
USoundMix* SoundMix |
Removes sound mix from all audio devices | AudioDeviceManager.h | |
FAudioDeviceHandle RequestAudioDevice
(
const FAudioDeviceParams& InParams |
Creates or requests an audio device instance internally and returns a handle to the audio device. | AudioDeviceManager.h | |
void ResetAllDynamicSoundVolumes() |
Reset all sound cue trims | AudioDeviceManager.h | |
void ResetDynamicSoundVolume
(
ESoundType SoundType, |
AudioDeviceManager.h | ||
void SetActiveDevice
(
uint32 InAudioDeviceHandle |
Sets which audio device is the active audio device. | AudioDeviceManager.h | |
void SetAudioDevice
(
UWorld& InWorld, |
Sets the device associated with the given world. | AudioDeviceManager.h | |
void SetDynamicSoundVolume
(
ESoundType SoundType, |
AudioDeviceManager.h | ||
void SetSoloDevice
(
Audio::FDeviceId InAudioDeviceHandle |
Sets an audio device to be solo'd | AudioDeviceManager.h | |
void StopSoundsUsingResource
(
USoundWave* InSoundWave, |
Stops sounds using the given resource on all audio devices. | AudioDeviceManager.h | |
void StopSourcesUsingBuffer
(
FSoundBuffer* Buffer |
AudioDeviceManager.h | ||
void TogglePlayAllDeviceAudio() |
Toggles playing audio for all active PIE sessions (and all devices). | AudioDeviceManager.h | |
void ToggleVisualize3dDebug() |
Toggles 3d visualization of 3d sounds on/off | AudioDeviceManager.h | |
void TrackResource
(
USoundWave* SoundWave, |
AudioDeviceManager.h | ||
void UnregisterSoundClass
(
USoundClass* SoundClass |
Unregisters the Sound Class for all active devices. | AudioDeviceManager.h | |
void UnregisterSoundSubmix
(
const USoundSubmixBase* SoundSubmix |
Registers the Sound Mix for all active devices. | AudioDeviceManager.h | |
void UnregisterWorld
(
UWorld* InWorld, |
Unregisters the world from the provided device Id | AudioDeviceManager.h | |
void UpdateActiveAudioDevices
(
bool bGameTicking |
Updates all active audio devices | AudioDeviceManager.h | |
void UpdateSourceEffectChain
(
const uint32 SourceEffectChainId, |
Updates source effect chain on all sources currently using the source effect chain. | AudioDeviceManager.h | |
void UpdateSubmix
(
USoundSubmixBase* SoundSubmix |
Updates this submix for any changes made. Broadcasts to all submix instances. | AudioDeviceManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static bool CanUseAudioDevice
(
const FAudioDeviceParams& InParams, |
This function is used to check if we can use an existing audio device. | AudioDeviceManager.h | |
static void EnableAggregateDeviceSupport
(
const bool bInEnableAggregateDevice |
AudioDeviceManager.h | ||
static FAudioDeviceManager * Get() |
Returns the AudioDeviceManager Singleton | AudioDeviceManager.h | |
static FAudioDevice * GetAudioDeviceFromWorldContext
(
const UObject* WorldContextObject |
AudioDeviceManager.h | ||
static Audio::FMixerDevice * GetAudioMixerDeviceFromWorldContext
(
const UObject* WorldContextObject |
AudioDeviceManager.h | ||
static FAudioDeviceManager * GetOrCreate() |
Conditionally Creates the AudioDeviceManager | AudioDeviceManager.h | |
static bool Initialize () |
Initializes the Manager. | AudioDeviceManager.h | |
static bool IsAggregateDeviceSupportEnabled() |
AudioDeviceManager.h | ||
static bool PreInitialize () |
Pre-initializes the Manager. | AudioDeviceManager.h | |
static void Shutdown() |
Shuts down the AudioDeviceManager and all AudioDevices. | AudioDeviceManager.h |