Language:
Discover
By Skill Level
By Category

UAudioComponent

Choose your OS:

Inheritance Hierarchy

Syntax

class UAudioComponent : public USceneComponent

Remarks

AudioComponent is used to play a Sound

Variables

Name Description

Public variable

FSoundAttenuati ...

 

AttenuationOverrides

If bOverrideSettings is true, the attenuation properties to use for sounds generated by this component

Public variable

USoundAttenuati ...

 

AttenuationSettings

If bOverrideSettings is false, the asset to use to determine attenuation properties for sounds generated by this component

Public variable

FName

 

AudioComponentUserID

Configurable, serialized ID for audio plugins

Public variable

uint32

 

AudioDeviceHandle

The specific audio device to play this component on

Public variable

uint8 : 1

 

bAllowSpatialization

Overrides spatialization enablement in either the attenuation asset or on this audio component's attenuation settings override.

Public variable

uint8 : 1

 

bAlwaysPlay

Whether to artificially prioritize the component to play

Public variable

uint8 : 1

 

bAutoDestroy

Auto destroy this component on completion

Public variable

uint8 : 1

 

bCenterChannelOnly

Whether or not this sound class forces sounds to the center channel

Public variable

uint8 : 1

 

bEnableLowPassFilter

Whether or not to apply a low-pass filter to the sound that plays in this audio component.

Public variable

uint8 : 1

 

bEQFilterApplied

Whether audio effects are applied

Public variable

uint8 : 1

 

bIgnoreForFlushing

If true, this sound will not be stopped when flushing the audio device.

Public variable

uint8 : 1

 

bIsMusic

Whether or not this audio component is a music clip

Public variable

uint8 : 1

 

bIsPaused

Whether or not this audio component has been paused

Public variable

uint8 : 1

 

bIsPreviewSound

Whether or not this sound is a preview sound

Public variable

uint8 : 1

 

bIsUISound

Whether or not this sound plays when the game is paused in the UI

Public variable

uint8 : 1

 

bOverrideAttenuation

Allows defining attenuation settings directly on this audio component without using an attenuation settings asset.

Public variable

uint8 : 1

 

bOverridePriority

Public variable

uint32 : 1

 

bOverrideSubtitlePriority

Whether or not to override the sound's subtitle priority.

Public variable

uint8 : 1

 

bPreviewComponent

Whether this audio component is previewing a sound

Public variable

uint8 : 1

 

bReverb

Whether or not the audio component should be excluded from reverb EQ processing

Public variable

uint8 : 1

 

bShouldRemainActiveIfDropped

Whether the wave instances should remain active if they're dropped by the prioritization code.

Public variable

uint8 : 1

 

bStopWhenOwnerDestroyed

Stop sound when owner is destroyed

Public variable

uint8 : 1

 

bSuppressSubtitles

If true, subtitles in the sound data will be ignored.

Public variable

USoundConcurren ...

 

ConcurrencySettings

What sound concurrency to use for sounds generated by this audio component

Public variable

TArray < struct ...

 

InstanceParameters

Array of per-instance parameters for this AudioComponent.

Public variable

float

 

LowPassFilterFrequency

The frequency of the lowpass filter (in hertz) to apply to this voice.

Public variable

float

 

OcclusionCheckInterval

While playing, this component will check for occlusion from its closest listener every this many seconds

Public variable

FOnAudioFinishe ...

 

OnAudioFinished

Called when we finish playing audio, either because it played to completion or because a Stop() call turned it off early

Public variable

FOnAudioFinishe ...

 

OnAudioFinishedNative

Shadow delegate for non UObject subscribers

Public variable

FOnAudioPlaybac ...

 

OnAudioPlaybackPercent

Called as a sound plays on the audio component to allow BP to perform actions based on playback percentage.

Public variable

FOnAudioPlaybac ...

 

OnAudioPlaybackPercentNative

Shadow delegate for non UObject subscribers

Public variable

FOnQueueSubtitl ...

 

OnQueueSubtitles

Called when subtitles are sent to the SubtitleManager.

Public variable

float

 

PitchModulationMax

The upper bound to use when randomly determining a pitch multiplier

Public variable

float

 

PitchModulationMin

The lower bound to use when randomly determining a pitch multiplier

Public variable

float

 

PitchMultiplier

A pitch multiplier to apply to sounds generated by this component

Public variable

float

 

Priority

A priority value that is used for sounds that play on this component that scales against final output volume.

Public variable

USoundBase *...

 

Sound

The sound to be played

Public variable

USoundClass ...

 

SoundClassOverride

Optional sound group this AudioComponent belongs to

Public variable

float

 

SubtitlePriority

Used by the subtitle manager to prioritize subtitles wave instances spawned by this component.

Public variable

float

 

VolumeModulationMax

The upper bound to use when randomly determining a volume multiplier

Public variable

float

 

VolumeModulationMin

The lower bound to use when randomly determining a volume multiplier

Public variable

float

 

VolumeMultiplier

A volume multiplier to apply to sounds generated by this component

Constructors

Name Description

Public function

UAudioComponent

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

void

 

AdjustAttenuation

(
    const FSoundAttenuationSettings & I...
)

Modify the attenuation settings of the audio component

Public function

void

 

AdjustVolume

(
    float AdjustVolumeDuration,
    float AdjustVolumeLevel
)

This will allow one to adjust the volume of an AudioComponent on the fly

Public function

bool

 

BP_GetAttenuationSettingsToApply

(
    FSoundAttenuationSettings & OutAtte...
)

Public function

void

 

CollectAttenuationShapesForVisualization

Collects the various attenuation shapes that may be applied to the sound played by the audio component for visualization in the editor or via the in game debug visualization.

Public function Virtual

void

 

FadeIn

(
    float FadeInDuration,
    float FadeVolumeLevel,
    float StartTime
)

This can be used in place of "play" when it is desired to fade in the sound over time.

Public function Virtual

void

 

FadeOut

(
    float FadeOutDuration,
    float FadeVolumeLevel
)

This is used in place of "stop" when it is desired to fade the volume of the sound before stopping.

Public function

const FSound ...

 

GetAttenuationSettingsToApply()

WITH_EDITOR.

Public function Static

UAudioCompon ...

 

GetAudioComponentFromID

(
    uint64 AudioComponentID
)

Public function

uint64

 

GetAudioComponentID()

Public function

FName

 

GetAudioComponentUserID()

Public function

FAudioDevice ...

 

GetAudioDevice()

Returns the active audio device to use for this component based on whether or not the component is playing in a world.

Public function Virtual

bool

 

IsPlaying()

True if this component is currently playing a SoundCue.

Public function Virtual

void

 

Play

(
    float StartTime
)

Start a sound playing on an audio component

Public function Static

void

 

PlaybackCompleted

(
    uint64 AudioComponentID,
    bool bFailedToStart
)

Protected function

void

 

PlayInternal

(
    const float StartTime,
    const float FadeInDuration,
    const float FadeVolumeLevel
)

Utility function called by Play and FadeIn to start a sound playing.

Public function

void

 

SetBoolParameter

(
    FName InName,
    bool InBool
)

Set a boolean instance parameter for use in sound cues played by this audio component

Public function

void

 

SetFloatParameter

(
    FName InName,
    float InFloat
)

Set a float instance parameter for use in sound cues played by this audio component

Public function

void

 

SetIntParameter

(
    FName InName,
    int32 InInt
)

Set an integer instance parameter for use in sound cues played by this audio component

Public function

void

 

SetLowPassFilterEnabled

(
    bool InLowPassFilterEnabled
)

Sets whether or not the low pass filter is enabled on the audio component.

Public function

void

 

SetLowPassFilterFrequency

(
    float InLowPassFilterFrequency
)

Sets lowpass filter frequency of the audio component.

Public function

void

 

SetPaused

(
    bool bPause
)

Pause an audio component playing its sound cue, issue any delegates if needed

Public function

void

 

SetPitchMultiplier

(
    float NewPitchMultiplier
)

Set a new pitch multiplier

Public function

void

 

SetSound

(
    USoundBase * NewSound
)

Set what sound is played by this component.

Public function

void

 

SetSoundParameter

(
    const FAudioComponentParam & Param
)

Sets the sound instance parameter.

Public function

void

 

SetSubmixSend

(
    USoundSubmix * Submix,
    float SendLevel
)

Sets how much audio the sound should send to the given submix.

Public function

void

 

SetUISound

(
    bool bInUISound
)

Set whether sounds generated by this audio component should be considered UI sounds

Public function

void

 

SetVolumeMultiplier

(
    float NewVolumeMultiplier
)

Set a new volume multiplier

Public function

void

 

SetWaveParameter

(
    FName InName,
    USoundWave * InWave
)

Set a sound wave instance parameter for use in sound cues played by this audio component

Public function Virtual

void

 

Stop()

Stop an audio component playing its sound cue, issue any delegates if needed

Public function

void

 

UpdateInteriorSettings

(
    bool bFullUpdate
)

Overridden from USceneComponent

Name Description

Public function Virtual

void

 

OnUpdateTransform

(
    EUpdateTransformFlags UpdateTransfo...,
    ETeleportType Teleport
)

Overridden from UActorComponent

Name Description

Public function Virtual

void

 

Activate

(
    bool bReset
)

Activates the SceneComponent

Public function Virtual

const UObjec ...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

Deactivate()

Deactivates the SceneComponent.

Public function Virtual

bool

 

IsReadyForOwnerToAutoDestroy()

Overridable check for a component to indicate to its Owner that it should prevent the Actor from auto destroying when finished

Public function Virtual

void

 

OnRegister()

WITH_EDITOR.

Public function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

FString

 

GetDetailedInfoInternal()

WITH_EDITOR.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object, and immediately after any undo/redo.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Constants

See Also

[](Audio/Overview/)

USoundBase

References

Module

Engine

Header

Runtime/Engine/Classes/Components/AudioComponent.h