Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UAudioComponent
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Components/AudioComponent.h |
Include | #include "Components/AudioComponent.h" |
Syntax
UCLASS (ClassGroup=(Audio, Common),
HideCategories=(Object, ActorComponent, Physics, Rendering, Mobility, LOD),
ShowCategories=Trigger, Meta=(BlueprintSpawnableComponent), MinimalAPI)
class UAudioComponent :
public USceneComponent ,
public ISoundParameterControllerInterface ,
public FQuartzTickableObject
Remarks
AudioComponent is used to play a Sound
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
int32 | ActiveCount | A count of how many times we've started playing |
![]() ![]() ![]() ![]() ![]() |
FSoundAttenuationSettings | AttenuationOverrides | If bOverrideSettings is true, the attenuation properties to use for sounds generated by this component |
![]() ![]() ![]() ![]() ![]() |
TObjectPtr< USoundAttenuation > | AttenuationSettings | If bOverrideSettings is false, the asset to use to determine attenuation properties for sounds generated by this component |
![]() ![]() |
FName | AudioComponentUserID | Configurable, serialized ID for audio plugins |
![]() |
uint32 | AudioDeviceID | The specific audio device to play this component on |
![]() ![]() ![]() ![]() |
EAttachmentRule | AutoAttachLocationRule | Options for how we handle our location when we attach to the AutoAttachParent, if bAutoManageAttachment is true. |
![]() ![]() ![]() ![]() ![]() |
TWeakObjectPtr< USceneComponent > | AutoAttachParent | Component we automatically attach to when activated, if bAutoManageAttachment is true. |
![]() ![]() ![]() ![]() |
EAttachmentRule | AutoAttachRotationRule | Options for how we handle our rotation when we attach to the AutoAttachParent, if bAutoManageAttachment is true. |
![]() ![]() ![]() ![]() |
EAttachmentRule | AutoAttachScaleRule | Options for how we handle our scale when we attach to the AutoAttachParent, if bAutoManageAttachment is true. |
![]() ![]() ![]() ![]() |
FName | AutoAttachSocketName | Socket we automatically attach to on the AutoAttachParent, if bAutoManageAttachment is true. |
![]() ![]() ![]() ![]() |
uint8: 1 | bAllowSpatialization | Overrides spatialization enablement in either the attenuation asset or on this audio component's attenuation settings override. |
![]() |
uint8: 1 | bAlwaysPlay | Whether to artificially prioritize the component to play |
![]() ![]() |
uint8: 1 | bAutoDestroy | Auto destroy this component on completion |
![]() ![]() ![]() ![]() |
uint8: 1 | bAutoManageAttachment | True if we should automatically attach to AutoAttachParent when Played, and detach from our parent when playback is completed. |
![]() ![]() ![]() ![]() |
uint8: 1 | bCanPlayMultipleInstances | If true, the Audio Component will play multiple sound instances at once. |
![]() |
uint8: 1 | bCenterChannelOnly | Whether or not this sound class forces sounds to the center channel |
![]() ![]() ![]() ![]() |
uint8: 1 | bDisableParameterUpdatesWhilePlaying | If true, the Audio Component will ignore parameter updates for already-playing sound(s). |
![]() ![]() ![]() ![]() |
uint8: 1 | bEnableHighPassFilter | Whether or not to apply a low-pass filter to the sound that plays in this audio component. |
![]() ![]() ![]() ![]() |
uint8: 1 | bEnableLowPassFilter | Whether or not to apply a low-pass filter to the sound that plays in this audio component. |
![]() |
uint8: 1 | bIgnoreForFlushing | If true, this sound will not be stopped when flushing the audio device. |
![]() |
uint8: 1 | bIsFadingOut | Whether or not fade out was triggered. |
![]() |
uint8: 1 | bIsMusic | Whether or not this audio component is a music clip |
![]() |
uint8: 1 | bIsPaused | Whether or not this audio component has been paused |
![]() |
uint8: 1 | bIsPreviewSound | Whether or not this sound is a preview sound |
![]() ![]() ![]() ![]() |
uint8: 1 | bIsUISound | Whether or not this sound plays when the game is paused in the UI |
![]() |
uint8: 1 | bIsVirtualized | Whether or not this audio component's sound is virtualized |
![]() ![]() ![]() ![]() ![]() |
uint8: 1 | bOverrideAttenuation | Allows defining attenuation settings directly on this audio component without using an attenuation settings asset. |
![]() ![]() ![]() ![]() |
uint8: 1 | bOverridePriority | Whether or not to override the priority of the given sound with the value provided. |
![]() ![]() ![]() ![]() |
uint8: 1 | bOverrideSubtitlePriority | Whether or not to override the sound's subtitle priority. |
![]() |
uint8: 1 | bPreviewComponent | Whether this audio component is previewing a sound |
![]() |
uint8: 1 | bReverb | Whether or not the audio component should be excluded from reverb EQ processing |
![]() ![]() |
uint8: 1 | bShouldRemainActiveIfDropped | Whether the wave instances should remain active if they're dropped by the prioritization code. |
![]() ![]() |
uint8: 1 | bStopWhenOwnerDestroyed | Stop sound when owner is destroyed |
![]() ![]() ![]() ![]() |
uint8: 1 | bSuppressSubtitles | If true, subtitles in the sound data will be ignored. |
![]() ![]() ![]() ![]() |
TSet< TObjectPtr< USoundConcurrency > > | ConcurrencySet | What sound concurrency rules to use for sounds generated by this audio component |
![]() ![]() ![]() ![]() |
TArray< FAudioParameter > | DefaultParameters | Array of parameters for this AudioComponent. |
![]() ![]() ![]() ![]() |
int32 | EnvelopeFollowerAttackTime | The attack time in milliseconds for the envelope follower. |
![]() ![]() ![]() ![]() |
int32 | EnvelopeFollowerReleaseTime | The release time in milliseconds for the envelope follower. |
![]() |
float | FadeInTimeDuration | How much time the audio component was told to fade in. |
![]() ![]() ![]() ![]() |
float | HighPassFilterFrequency | If enabled, the frequency of the Highpass Filter (in Hz) to apply to this voice. |
![]() ![]() ![]() |
TArray< FAudioParameter > | InstanceParameters | Array of transient parameters for this AudioComponent instance. |
![]() ![]() ![]() ![]() |
float | LowPassFilterFrequency | If enabled, the frequency of the Lowpass Filter (in Hz) to apply to this voice. |
![]() ![]() ![]() ![]() |
FSoundModulationDefaultRoutingSettings | ModulationRouting | |
![]() |
float | OcclusionCheckInterval | While playing, this component will check for occlusion from its closest listener every this many seconds |
![]() ![]() ![]() |
FOnAudioFinished | OnAudioFinished | Called when we finish playing audio, either because it played to completion or because a Stop() call turned it off early |
![]() |
FOnAudioFinishedNative | OnAudioFinishedNative | Shadow delegate for non UObject subscribers |
![]() ![]() ![]() |
FOnAudioMultiEnvelopeValue | OnAudioMultiEnvelopeValue | |
![]() |
FOnAudioMultiEnvelopeValueNative | OnAudioMultiEnvelopeValueNative | Shadow delegate for non UObject subscribers |
![]() ![]() ![]() |
FOnAudioPlaybackPercent | OnAudioPlaybackPercent | Called as a sound plays on the audio component to allow BP to perform actions based on playback percentage. |
![]() |
FOnAudioPlaybackPercentNative | OnAudioPlaybackPercentNative | Shadow delegate for non UObject subscribers |
![]() ![]() ![]() |
FOnAudioPlayStateChanged | OnAudioPlayStateChanged | This function returns the Targeted Audio Component's current Play State. |
![]() |
FOnAudioPlayStateChangedNative | OnAudioPlayStateChangedNative | Shadow delegate for non UObject subscribers |
![]() ![]() ![]() |
FOnAudioSingleEnvelopeValue | OnAudioSingleEnvelopeValue | |
![]() |
FOnAudioSingleEnvelopeValueNative | OnAudioSingleEnvelopeValueNative | Shadow delegate for non UObject subscribers |
![]() ![]() ![]() |
FOnAudioVirtualizationChanged | OnAudioVirtualizationChanged | Called when virtualization state changes |
![]() |
FOnAudioVirtualizationChangedNative | OnAudioVirtualizationChangedNative | Shadow delegate for non UObject subscribers |
![]() ![]() |
FOnQueueSubtitles | OnQueueSubtitles | Called when subtitles are sent to the SubtitleManager. |
![]() ![]() ![]() ![]() |
float | PitchModulationMax | The upper bound to use when randomly determining a pitch multiplier |
![]() ![]() ![]() ![]() |
float | PitchModulationMin | The lower bound to use when randomly determining a pitch multiplier |
![]() ![]() ![]() ![]() |
float | PitchMultiplier | A pitch multiplier to apply to sounds generated by this component |
![]() ![]() ![]() ![]() |
float | Priority | If enabled, overrides the priority of the selected sound with the value provided. |
![]() |
FRandomStream | RandomStream | |
![]() ![]() ![]() ![]() |
TObjectPtr< USoundBase > | Sound | The sound to be played |
![]() ![]() ![]() |
TObjectPtr< USoundClass > | SoundClassOverride | SoundClass that overrides that set on the referenced SoundBase when component is played. |
![]() ![]() ![]() ![]() |
TObjectPtr< USoundEffectSourcePresetChain > | SourceEffectChain | The chain of Source Effects to apply to the sounds playing on the Audio Component |
![]() ![]() ![]() ![]() |
float | SubtitlePriority | Used by the subtitle manager to prioritize subtitles wave instances spawned by this component. |
![]() |
float | TimeAudioComponentPlayed | What time the audio component was told to play. Used to compute audio component state. |
![]() ![]() ![]() ![]() |
float | VolumeModulationMax | The upper bound to use when randomly determining a volume multiplier |
![]() ![]() ![]() ![]() |
float | VolumeModulationMin | The lower bound to use when randomly determining a volume multiplier |
![]() ![]() ![]() ![]() |
float | VolumeMultiplier | A volume multiplier to apply to sounds generated by this component |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UAudioComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() |
void | AddModulationRouting
(
const TSet< USoundModulatorBase* >& Modulators, |
Adds the given set of Modulators to the modulators currently set on the Audio Component. |
![]() ![]() ![]() |
void | AdjustAttenuation
(
const FSoundAttenuationSettings& InAttenuationSettings |
This function is used to modify the Attenuation Settings on the targeted Audio Component instance. |
![]() ![]() ![]() |
void | AdjustVolume
(
float AdjustVolumeDuration, |
This function allows designers to trigger an adjustment to the sound instance’s playback Volume with options for smoothly applying a curve over time. |
![]() |
void | AdjustVolumeInternal
(
float AdjustVolumeDuration, |
|
![]() ![]() ![]() |
bool | BP_GetAttenuationSettingsToApply
(
FSoundAttenuationSettings& OutAttenuationSettings |
Retrieves Attenuation Settings data on the targeted Audio Component. |
![]() ![]() |
void | 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. | |
![]() ![]() ![]() ![]() |
void | FadeIn
(
float FadeInDuration, |
This function allows designers to call Play on an Audio Component instance while applying a volume curve over time. |
![]() ![]() ![]() ![]() |
void | FadeOut
(
float FadeOutDuration, |
This function allows designers to call a delayed Stop on an Audio Component instance while applying a volume curve over time. |
![]() ![]() |
const TObjectPtr< USoundAttenuation > | ||
![]() ![]() |
const FSoundAttenuationSettings * | Returns a pointer to the attenuation settings to be used (if any) for this audio component dependent on the SoundAttenuation asset or overrides set. | |
![]() ![]() |
UAudioComponent * | GetAudioComponentFromID
(
uint64 AudioComponentID |
|
![]() ![]() |
uint64 | ||
![]() ![]() |
FName | ||
![]() ![]() ![]() ![]() |
bool | GetCookedEnvelopeData
(
float& OutEnvelopeData |
Retrieves Cooked Amplitude Envelope Data at the current playback time. |
![]() ![]() ![]() ![]() |
bool | GetCookedEnvelopeDataForAllPlayingSounds
(
TArray< FSoundWaveEnvelopeDataPerSound >& OutEnvelopeData |
Retrieves the current-time amplitude envelope data of the sounds playing on the audio component. |
![]() ![]() ![]() |
bool | GetCookedFFTData
(
const TArray< float >& FrequenciesToGet, |
Retrieves the current-time cooked spectral data of the sounds playing on the audio component. |
![]() ![]() ![]() |
bool | GetCookedFFTDataForAllPlayingSounds
(
TArray< FSoundWaveSpectralDataPerSound >& OutSoundWaveSpectralData |
Retrieves the current-time cooked spectral data of the sounds playing on the audio component. |
![]() ![]() |
uint32 | ||
![]() ![]() ![]() ![]() |
EAudioComponentPlayState | GetPlayState () |
Returns the enumerated play states of the audio component. |
![]() ![]() |
const FSharedISourceBufferListenerPtr & | Gets Source Buffer Listener | |
![]() ![]() ![]() ![]() |
bool | Queries whether or not the targeted Audio Component instance’s sound has Amplitude Envelope Data, returns FALSE if none found. | |
![]() ![]() ![]() ![]() |
bool | Queries if the sound wave playing in this audio component has cooked FFT data, returns FALSE if none found. | |
![]() ![]() ![]() ![]() |
bool | Returns if the sound is virtualized. | |
![]() ![]() ![]() ![]() |
void | Play
(
float StartTime |
Begins playing the targeted Audio Component's sound at the designated Start Time, seeking into a sound. |
![]() ![]() |
void | PlaybackCompleted
(
uint64 AudioComponentID, |
|
![]() |
void | PlayInternal
(
const PlayInternalRequestData& InPlayRequestData, |
Utility function called by Play and FadeIn to start a sound playing. |
![]() ![]() ![]() ![]() |
void | PlayQuantized
(
const UObject* WorldContextObject, |
Start a sound playing on an audio component on a given quantization boundary with the handle to an existing clock |
![]() ![]() |
void | PlayQueuedQuantizedInternal
(
const UObject* WorldContextObject, |
For if this is being played through a sound queued through Quartz. |
![]() ![]() ![]() ![]() |
void | RemoveModulationRouting
(
const TSet< USoundModulatorBase* >& Modulators, |
Removes the given set of Modulators to the modulators currently set on the Audio Component. |
![]() ![]() ![]() |
void | SetAttenuationOverrides
(
const FSoundAttenuationSettings& InAttenuationOverrides |
|
![]() ![]() ![]() |
void | SetAttenuationSettings
(
USoundAttenuation* InAttenuationSettings |
|
![]() ![]() ![]() |
void | SetAudioBusSendPostEffect
(
UAudioBus* AudioBus, |
Sets how much audio the sound should send to the given Audio Bus (POST Source Effects). |
![]() ![]() ![]() |
void | SetAudioBusSendPreEffect
(
UAudioBus* AudioBus, |
Sets how much audio the sound should send to the given Audio Bus (PRE Source Effects). |
![]() |
void | Set when the sound is finished with initial fading in | |
![]() ![]() ![]() |
void | SetHighPassFilterEnabled
(
bool InHighPassFilterEnabled |
When set to TRUE, enables an additional High Pass Filter Frequency to be calculated in with the sound instance’s HPF total, allowing designers to set filter settings for the targeted Audio Component’s sound instance. |
![]() ![]() ![]() |
void | SetHighPassFilterFrequency
(
float InHighPassFilterFrequency |
Sets a cutoff frequency, in Hz, for the targeted Audio Component’s sound’s High Pass Filter calculation. |
![]() |
void | SetIsVirtualized
(
bool bInIsVirtualized |
Sets whether or not sound instance is virtualized |
![]() ![]() ![]() |
void | SetLowPassFilterEnabled
(
bool InLowPassFilterEnabled |
When set to TRUE, enables an additional Low Pass Filter Frequency to be calculated in with the sound instance’s LPF total, allowing designers to set filter settings for the targeted Audio Component’s sound instance. |
![]() ![]() ![]() |
void | SetLowPassFilterFrequency
(
float InLowPassFilterFrequency |
Sets a cutoff frequency, in Hz, for the targeted Audio Component’s sound’s Low Pass Filter calculation. |
![]() ![]() ![]() ![]() |
void | SetModulationRouting
(
const TSet< USoundModulatorBase* >& Modulators, |
Sets the routing for one of the given Audio component's Modulation Destinations. |
![]() ![]() ![]() |
void | SetOutputToBusOnly
(
bool bInOutputToBusOnly |
Sets whether or not to output the audio to bus only. |
![]() ![]() ![]() |
void | SetOverrideAttenuation
(
bool bInOverrideAttenuation |
|
![]() ![]() ![]() |
void | SetPaused
(
bool bPause |
Pause an audio component playing its sound cue, issue any delegates if needed |
![]() ![]() ![]() |
void | SetPitchMultiplier
(
float NewPitchMultiplier |
Set a new pitch multiplier |
![]() |
void | SetPlaybackTimes
(
const TMap< uint32, float >& InSoundWavePlaybackTimes |
Sets the audio thread playback time as used by the active sound playing this audio component Will be set if the audio component is using baked FFT or envelope following data so as to be able to feed that data to BP based on playback time |
![]() ![]() ![]() |
void | SetSound
(
USoundBase* NewSound |
Set what sound is played by this component. |
![]() |
void | SetSourceBufferListener
(
const FSharedISourceBufferListenerPtr& InSourceBufferListener, |
Sets Source Buffer Listener |
![]() ![]() ![]() |
void | SetSourceBusSendPostEffect
(
USoundSourceBus* SoundSourceBus, |
Allows designers to target a specific Audio Component instance’s sound and set the send level (volume of sound copied) to the indicated Source Bus. |
![]() ![]() ![]() |
void | SetSourceBusSendPreEffect
(
USoundSourceBus* SoundSourceBus, |
Allows designers to target a specific Audio Component instance’s sound and set the send level (volume of sound copied) to the indicated Source Bus. |
![]() |
void | SetSourceEffectChain
(
USoundEffectSourcePresetChain* InSourceEffectChain |
|
![]() ![]() ![]() |
void | SetSubmixSend
(
USoundSubmixBase* Submix, |
Allows designers to target a specific Audio Component instance’s sound set the send level (volume of sound copied) to the indicated Submix. |
![]() ![]() ![]() |
void | SetUISound
(
bool bInUISound |
Set whether sounds generated by this audio component should be considered UI sounds |
![]() ![]() ![]() |
void | SetVolumeMultiplier
(
float NewVolumeMultiplier |
Set a new volume multiplier |
![]() ![]() ![]() |
void | SetWaveParameter
(
FName InName, |
Sets the parameter matching the name indicated to the provided Wave. |
![]() ![]() ![]() ![]() |
void | Stop () |
Stop an audio component's sound, issue any delegates if needed |
![]() ![]() ![]() |
void | StopDelayed
(
float DelayTime |
Cues request to stop sound after the provided delay (in seconds), stopping immediately if delay is zero or negative |
![]() ![]() ![]() ![]() ![]() |
UPARAM
(
DisplayName |
Gets the set of currently active modulators for a given Modulation Destination. | |
![]() |
void | Utility function that updates which texture is displayed on the sprite dependent on the properties of the Audio Component. |
Overridden from USceneComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FBoxSphereBounds | CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. |
![]() ![]() |
void | OnUpdateTransform
(
EUpdateTransformFlags UpdateTransformFlags, |
Native callback when this component is moved |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Activate
(
bool bReset |
Activates the SceneComponent, should be overridden by native child classes. |
![]() ![]() ![]() |
const UObject * | Give a readable name for this component, including asset name if applicable | |
![]() ![]() |
void | Deactivate () |
Deactivates the SceneComponent. |
![]() ![]() |
void | EndPlay
(
const EEndPlayReason::Type EndPlayReason |
Ends gameplay for this component. |
![]() ![]() ![]() |
bool | Overridable check for a component to indicate to its Owner that it should prevent the Actor from auto destroying when finished | |
![]() ![]() |
void | OnRegister () |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. |
![]() ![]() |
void | OnUnregister () |
Called when a component is unregistered. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | BeginDestroy () |
Called before destroying the object. |
![]() ![]() ![]() |
FString | This function actually does the work for the GetDetailedInfo() and is virtual. | |
![]() ![]() |
void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally |
![]() ![]() |
void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. |
![]() ![]() |
void | Handles reading, writing, and reference collecting using FArchive. |
Overridden from UObjectBase
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FName | Overridable method to return a logical name for identification in stats. |
Overridden from ISoundParameterControllerInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FAudioDevice * | SoundParameterControllerInterface Implementation | |
![]() ![]() ![]() |
bool | ||
![]() ![]() ![]() |
uint64 | Returns the id of the sound owner's instance associated with the parameter interface. | |
![]() ![]() |
TArray< FAudioParameter > & | Returns the Game Thread copy of parameters to modify in place. | |
![]() ![]() |
USoundBase * | GetSound () |
Returns the USoundBase used to initialize instance parameters to update. |
![]() ![]() ![]() ![]() ![]() |
bool | IsPlaying () |
Returns TRUE if the targeted Audio Component’s sound is playing. |
Overridden from IAudioParameterControllerInterface
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Resets all parameters to their original values. | |
![]() ![]() ![]() ![]() |
void | SetBoolParameter
(
FName InName, |
Sets a named Boolean. |
![]() ![]() ![]() ![]() |
void | SetFloatParameter
(
FName InName, |
Sets a named Float. |
![]() ![]() ![]() ![]() |
void | SetIntParameter
(
FName InName, |
Sets a named Int32. |
Overridden from FQuartzTickableObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | ProcessCommand
(
const Audio::FQuartzQuantizedCommandDelegateData& Data |
Used for processing queue commands. |
![]() ![]() |
void | ProcessCommand
(
const Audio::FQuartzMetronomeDelegateData& Data |
|
![]() ![]() |
void | ProcessCommand
(
const Audio::FQuartzQueueCommandData& InQueueCommandData |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
PlayInternalRequestData |
Constants
Name | Description |
---|---|
AudioComponentIDCounter | |
AudioIDToComponentMap | |
AudioIDToComponentMapLock |
Deprecated Variables
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
TObjectPtr< USoundConcurrency > | ConcurrencySettings_DEPRECATED | What sound concurrency to use for sounds generated by this audio component |
![]() ![]() |
float | HighFrequencyGainMultiplier_DEPRECATED | |
![]() ![]() |
float | VolumeWeightedPriorityScale_DEPRECATED |