![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AudioDeviceManager.h>
Static Public Member Functions | |
| static ENGINE_API FAudioDevice * | GetAudioDeviceFromWorldContext (const UObject *WorldContextObject) |
| static ENGINE_API Audio::FMixerDevice * | GetAudioMixerDeviceFromWorldContext (const UObject *WorldContextObject) |
| static ENGINE_API bool | PreInitialize () |
| static ENGINE_API bool | Initialize () |
| static ENGINE_API FAudioDeviceManager * | Get () |
| 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 |
Class for managing multiple audio devices.
| FAudioDeviceManager::FAudioDeviceManager | ( | ) |
Constructor
| PRAGMA_DISABLE_DEPRECATION_WARNINGS FAudioDeviceManager::~FAudioDeviceManager | ( | ) |
Destructor
| void FAudioDeviceManager::AddReferencedObjects | ( | FReferenceCollector & | Collector | ) |
Tracks objects in the active audio devices.
| bool FAudioDeviceManager::CreateMainAudioDevice | ( | ) |
Creates the main audio device.
|
static |
| void FAudioDeviceManager::FreeBufferResource | ( | FSoundBuffer * | SoundBuffer | ) |
| void FAudioDeviceManager::FreeResource | ( | USoundWave * | SoundWave | ) |
Frees the given sound wave resource from the device manager
|
static |
Returns the AudioDeviceManager Singleton
| 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.
| 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.
|
static |
| IAudioDeviceModule * FAudioDeviceManager::GetAudioDeviceModule | ( | ) |
returns the currently used audio device module for this platform. returns nullptr if Initialize() has not been called yet.
| 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.
| const FAudioDevice * FAudioDeviceManager::GetAudioDeviceRaw | ( | Audio::FDeviceId | InDeviceID | ) | const |
| TArray< FAudioDevice * > FAudioDeviceManager::GetAudioDevices | ( | ) | const |
Returns all the audio devices managed by device manager.
| Audio::FAudioFormatSettings & FAudioDeviceManager::GetAudioFormatSettings | ( | ) | const |
|
static |
| FAudioDeviceParams FAudioDeviceManager::GetDefaultParamsForNewWorld | ( | ) |
| float FAudioDeviceManager::GetDynamicSoundVolume | ( | ESoundType | SoundType, |
| const FName & | SoundName | ||
| ) | const |
Get, reset, or set a sound cue trim
|
inline |
Returns the handle to the main audio device.
|
inline |
|
inline |
| uint8 FAudioDeviceManager::GetNumActiveAudioDevices | ( | ) | const |
Returns the current number of active audio devices.
| uint8 FAudioDeviceManager::GetNumMainAudioDeviceWorlds | ( | ) | const |
Returns the number of worlds (e.g. PIE viewports) using the main audio device.
| FSoundBuffer * FAudioDeviceManager::GetSoundBufferForResourceID | ( | uint32 | ResourceID | ) |
| TArray< UWorld * > FAudioDeviceManager::GetWorldsUsingAudioDevice | ( | const Audio::FDeviceId & | InID | ) | const |
|
static |
Initializes the Manager. NOTE: If the manager hasn't been PreInitialized, that stage will be performed first.
| void FAudioDeviceManager::InitSoundClasses | ( | ) |
Initializes the sound class for all active devices.
| void FAudioDeviceManager::InitSoundEffectPresets | ( | ) |
Initialize all sound effect presets.
| void FAudioDeviceManager::InitSoundSubmixes | ( | ) |
Initializes the sound mixes for all active devices.
|
static |
| bool FAudioDeviceManager::IsAlwaysPlayNonRealtimeDeviceAudio | ( | ) | const |
Gets whether or not non-realtime devices should play their audio.
|
inline |
Gets whether or not all devices should play their audio.
| bool FAudioDeviceManager::IsValidAudioDevice | ( | Audio::FDeviceId | DeviceID | ) | const |
Returns whether the audio device handle is valid (i.e. points to an actual audio device instance)
| bool FAudioDeviceManager::IsVisualizeDebug3dEnabled | ( | ) | const |
Is debug visualization of 3d sounds enabled
| void FAudioDeviceManager::IterateOverAllDevices | ( | TUniqueFunction< void(Audio::FDeviceId, const FAudioDevice *)> | ForEachDevice | ) | const |
| void FAudioDeviceManager::IterateOverAllDevices | ( | TUniqueFunction< void(Audio::FDeviceId, FAudioDevice *)> | ForEachDevice | ) |
Iterates over all managed audio devices
| void FAudioDeviceManager::LogListOfAudioDevices | ( | ) |
|
static |
| void FAudioDeviceManager::RegisterSoundClass | ( | USoundClass * | SoundClass | ) |
Registers the Sound Class for all active devices.
| void FAudioDeviceManager::RegisterSoundSubmix | ( | USoundSubmixBase * | SoundSubmix | ) |
Registers the Sound Mix for all active devices.
| void FAudioDeviceManager::RegisterWorld | ( | UWorld * | InWorld, |
| Audio::FDeviceId | DeviceId | ||
| ) |
Registers the world with the provided device Id
Removes the sound buffer for the given resource id
Removes sound mix from all audio devices
| 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.
| void FAudioDeviceManager::ResetAllDynamicSoundVolumes | ( | ) |
Reset all sound cue trims
| void FAudioDeviceManager::ResetDynamicSoundVolume | ( | ESoundType | SoundType, |
| const FName & | SoundName | ||
| ) |
Sets which audio device is the active audio device.
| void FAudioDeviceManager::SetAudioDevice | ( | UWorld & | InWorld, |
| Audio::FDeviceId | InDeviceID | ||
| ) |
Sets the device associated with the given world.
| void FAudioDeviceManager::SetDynamicSoundVolume | ( | ESoundType | SoundType, |
| const FName & | SoundName, | ||
| float | Volume | ||
| ) |
| void FAudioDeviceManager::SetSoloDevice | ( | Audio::FDeviceId | InAudioDeviceHandle | ) |
Sets an audio device to be solo'd
|
static |
Shuts down the AudioDeviceManager and all AudioDevices.
| void FAudioDeviceManager::StopSoundsUsingResource | ( | class USoundWave * | InSoundWave, |
| TArray< UAudioComponent * > * | StoppedComponents = nullptr |
||
| ) |
Stops sounds using the given resource on all audio devices.
| void FAudioDeviceManager::StopSourcesUsingBuffer | ( | FSoundBuffer * | Buffer | ) |
| void FAudioDeviceManager::TogglePlayAllDeviceAudio | ( | ) |
Toggles playing audio for all active PIE sessions (and all devices).
| void FAudioDeviceManager::ToggleVisualize3dDebug | ( | ) |
Toggles 3d visualization of 3d sounds on/off
| void FAudioDeviceManager::TrackResource | ( | USoundWave * | SoundWave, |
| FSoundBuffer * | Buffer | ||
| ) |
| void FAudioDeviceManager::UnregisterSoundClass | ( | USoundClass * | SoundClass | ) |
Unregisters the Sound Class for all active devices.
| void FAudioDeviceManager::UnregisterSoundSubmix | ( | const USoundSubmixBase * | SoundSubmix | ) |
Registers the Sound Mix for all active devices.
| void FAudioDeviceManager::UnregisterWorld | ( | UWorld * | InWorld, |
| Audio::FDeviceId | DeviceId | ||
| ) |
Unregisters the world from the provided device Id
Updates all active audio devices
| 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.
| void FAudioDeviceManager::UpdateSubmix | ( | USoundSubmixBase * | SoundSubmix | ) |
Updates this submix for any changes made. Broadcasts to all submix instances.
|
friend |
| TArray<FSoundBuffer*> FAudioDeviceManager::Buffers |
Array of all created buffers
| TMap<int32, FSoundBuffer*> FAudioDeviceManager::WaveBufferMap |
Look up associating a USoundWave's resource ID with sound buffers