RealDocs

UAudioComponent::GetAudioDevice

function Engine Since 5.0
#include "Components/AudioComponent.h"
Access: public Specifiers: overrideconst

Description

Returns the audio device this component's sounds are being rendered through, implementing the ISoundParameterControllerInterface accessor.

Caveats & Gotchas

  • Can return nullptr if the component isn't registered in a world with an active audio device (e.g. a server running with sound disabled, or a component not yet registered).
  • Not Blueprint-exposed; this exists to satisfy the ISoundParameterControllerInterface contract used internally by the parameter system.

Signature

FAudioDevice* GetAudioDevice() const override

Return Type

FAudioDevice*

Example

Accessing the owning audio device C++
if (FAudioDevice* Device = AudioComponent->GetAudioDevice())
{
	Device->SetTransientMasterVolume(0.5f);
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.