UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
USynthComponent Class Reference

#include <SynthComponent.h>

+ Inheritance diagram for USynthComponent:

Public Member Functions

AUDIOMIXER_API USynthComponent (const FObjectInitializer &ObjectInitializer)
 
virtual AUDIOMIXER_API void Activate (bool bReset=false) override
 
virtual AUDIOMIXER_API void Deactivate () override
 
virtual AUDIOMIXER_API void OnRegister () override
 
virtual AUDIOMIXER_API void OnUnregister () override
 
virtual AUDIOMIXER_API bool IsReadyForOwnerToAutoDestroy () const override
 
virtual AUDIOMIXER_API void EndPlay (const EEndPlayReason::Type Reason) override
 
virtual AUDIOMIXER_API void Serialize (FArchive &Ar) override
 
AUDIOMIXER_API void Start ()
 
AUDIOMIXER_API void Stop ()
 
AUDIOMIXER_API bool IsPlaying () const
 
AUDIOMIXER_API void SetVolumeMultiplier (float VolumeMultiplier)
 
AUDIOMIXER_API void SetSubmixSend (USoundSubmixBase *Submix, float SendLevel)
 
AUDIOMIXER_API void SetSourceBusSendPreEffect (USoundSourceBus *SoundSourceBus, float SourceBusSendLevel)
 
AUDIOMIXER_API void SetSourceBusSendPostEffect (USoundSourceBus *SoundSourceBus, float SourceBusSendLevel)
 
AUDIOMIXER_API void SetAudioBusSendPreEffect (UAudioBus *AudioBus, float AudioBusSendLevel)
 
AUDIOMIXER_API void SetAudioBusSendPostEffect (UAudioBus *AudioBus, float AudioBusSendLevel)
 
AUDIOMIXER_API void SetLowPassFilterEnabled (bool InLowPassFilterEnabled)
 
virtual AUDIOMIXER_API void SetLowPassFilterFrequency (float InLowPassFilterFrequency)
 
AUDIOMIXER_API void SetOutputToBusOnly (bool bInOutputToBusOnly)
 
AUDIOMIXER_API void FadeIn (float FadeInDuration, float FadeVolumeLevel=1.0f, float StartTime=0.0f, const EAudioFaderCurve FadeCurve=EAudioFaderCurve::Linear) const
 
AUDIOMIXER_API void FadeOut (float FadeOutDuration, float FadeVolumeLevel, const EAudioFaderCurve FadeCurve=EAudioFaderCurve::Linear) const
 
AUDIOMIXER_API void AdjustVolume (float AdjustVolumeDuration, float AdjustVolumeLevel, const EAudioFaderCurve FadeCurve=EAudioFaderCurve::Linear) const
 
AUDIOMIXER_API void SetModulationRouting (const TSet< USoundModulatorBase * > &Modulators, const EModulationDestination Destination, const EModulationRouting RoutingMethod=EModulationRouting::Inherit)
 
AUDIOMIXER_API UPARAM (DisplayName="Modulators") TSet< USoundModulatorBase * > GetModulators(const EModulationDestination Destination)
 
AUDIOMIXER_API void Initialize (int32 SampleRateOverride=INDEX_NONE)
 
AUDIOMIXER_API void CreateAudioComponent ()
 
AUDIOMIXER_API UAudioComponentGetAudioComponent ()
 
AUDIOMIXER_API void OnAudioComponentEnvelopeValue (const UAudioComponent *AudioComponent, const USoundWave *SoundWave, const float EnvelopeValue)
 
AUDIOMIXER_API void AddAudioBufferListener (IAudioBufferListener *InAudioBufferListener)
 
AUDIOMIXER_API void RemoveAudioBufferListener (IAudioBufferListener *InAudioBufferListener)
 
virtual AUDIOMIXER_API USoundClassGetSoundClass ()
 
virtual AUDIOMIXER_API void BeginDestroy () override
 

Public Attributes

uint8 bAutoDestroy: 1
 
uint8 bStopWhenOwnerDestroyed: 1
 
uint8 bAllowSpatialization: 1
 
uint8 bOverrideAttenuation: 1
 
uint32 bEnableBusSends: 1
 
uint32 bEnableBaseSubmix: 1
 
uint32 bEnableSubmixSends: 1
 
TObjectPtr< class USoundAttenuationAttenuationSettings
 
struct FSoundAttenuationSettings AttenuationOverrides
 
TObjectPtr< USoundConcurrencyConcurrencySettings_DEPRECATED
 
TSet< TObjectPtr< USoundConcurrency > > ConcurrencySet
 
FSoundModulationDefaultRoutingSettings ModulationRouting
 
TObjectPtr< USoundClassSoundClass
 
TObjectPtr< USoundEffectSourcePresetChainSourceEffectChain
 
TObjectPtr< USoundSubmixBaseSoundSubmix
 
TArray< FSoundSubmixSendInfoSoundSubmixSends
 
TArray< FSoundSourceBusSendInfoBusSends
 
TArray< FSoundSourceBusSendInfoPreEffectBusSends
 
uint8 bIsUISound: 1
 
uint8 bIsPreviewSound: 1
 
uint8 bAlwaysPlay: 1
 
int32 EnvelopeFollowerAttackTime
 
int32 EnvelopeFollowerReleaseTime
 
FOnSynthEnvelopeValue OnAudioEnvelopeValue
 
FOnSynthEnvelopeValueNative OnAudioEnvelopeValueNative
 

Protected Member Functions

AUDIOMIXER_API void SynthCommand (TFunction< void()> Command)
 
virtual bool Init (int32 &SampleRate)
 
virtual void OnStart ()
 
virtual void OnStop ()
 
virtual void OnBeginGenerate ()
 
virtual void OnEndGenerate ()
 
virtual int32 OnGenerateAudio (float *OutAudio, int32 NumSamples)
 
virtual ISoundGeneratorPtr CreateSoundGenerator (const FSoundGeneratorInitParams &InParams)
 
AUDIOMIXER_API int32 OnGeneratePCMAudio (float *GeneratedPCMData, int32 NumSamples)
 
AUDIOMIXER_API FAudioDeviceGetAudioDevice () const
 

Protected Attributes

int32 NumChannels
 
int32 PreferredBufferLength
 

Friends

class USynthSound
 

Constructor & Destructor Documentation

◆ USynthComponent()

USynthComponent::USynthComponent ( const FObjectInitializer ObjectInitializer)

Member Function Documentation

◆ Activate()

void USynthComponent::Activate ( bool  bReset = false)
overridevirtual

Reimplemented in UMediaSoundComponent.

◆ AddAudioBufferListener()

AUDIOMIXER_API void USynthComponent::AddAudioBufferListener ( IAudioBufferListener InAudioBufferListener)

◆ AdjustVolume()

void USynthComponent::AdjustVolume ( float  AdjustVolumeDuration,
float  AdjustVolumeLevel,
const EAudioFaderCurve  FadeCurve = EAudioFaderCurve::Linear 
) const

This function allows designers to trigger an adjustment to the sound instance’s playback Volume with options for smoothly applying a curve over time.

Parameters
AdjustVolumeDurationThe length of time in which to interpolate between the initial volume and the new volume.
AdjustVolumeLevelThe new volume to set the Audio Component to.
FadeCurveThe curve used when interpolating between the old and new volume.

◆ BeginDestroy()

void USynthComponent::BeginDestroy ( )
overridevirtual

◆ CreateAudioComponent()

void USynthComponent::CreateAudioComponent ( )

Creates the audio component if it hasn't already been created yet. This should only be used when trying to assign explicit settings to the AudioComponent before calling Start().

◆ CreateSoundGenerator()

virtual ISoundGeneratorPtr USynthComponent::CreateSoundGenerator ( const FSoundGeneratorInitParams InParams)
inlineprotectedvirtual

Reimplemented in UMediaSoundComponent.

◆ Deactivate()

void USynthComponent::Deactivate ( )
overridevirtual

Reimplemented in UMediaSoundComponent.

◆ EndPlay()

void USynthComponent::EndPlay ( const EEndPlayReason::Type  Reason)
overridevirtual

◆ FadeIn()

void USynthComponent::FadeIn ( float  FadeInDuration,
float  FadeVolumeLevel = 1.0f,
float  StartTime = 0.0f,
const EAudioFaderCurve  FadeCurve = EAudioFaderCurve::Linear 
) const

This function allows designers to call Play on an Audio Component instance while applying a volume curve over time. Parameters allow designers to indicate the duration of the fade, the curve shape, and the start time if seeking into the sound.

Parameters
FadeInDurationHow long it should take to reach the FadeVolumeLevel
FadeVolumeLevelThe percentage of the AudioComponents's calculated volume to fade to
FadeCurveThe curve to use when interpolating between the old and new volume

◆ FadeOut()

void USynthComponent::FadeOut ( float  FadeOutDuration,
float  FadeVolumeLevel,
const EAudioFaderCurve  FadeCurve = EAudioFaderCurve::Linear 
) const

This function allows designers to call a delayed Stop on an Audio Component instance while applying a volume curve over time. Parameters allow designers to indicate the duration of the fade and the curve shape.

Parameters
FadeOutDurationhow long it should take to reach the FadeVolumeLevel
FadeVolumeLevelthe percentage of the AudioComponents's calculated volume in which to fade to
FadeCurveThe curve to use when interpolating between the old and new volume

◆ GetAudioComponent()

UAudioComponent * USynthComponent::GetAudioComponent ( )

Retrieves this synth component's audio component.

◆ GetAudioDevice()

FAudioDevice * USynthComponent::GetAudioDevice ( ) const
protected

◆ GetSoundClass()

USoundClass * USynthComponent::GetSoundClass ( )
virtual

Reimplemented in UMediaSoundComponent.

◆ Init()

virtual bool USynthComponent::Init ( int32 SampleRate)
inlineprotectedvirtual

Reimplemented in UMediaSoundComponent.

◆ Initialize()

void USynthComponent::Initialize ( int32  SampleRateOverride = INDEX_NONE)

Call if creating this synth component not via an actor component in BP, but in code or some other location. Optionally override the sample rate of the sound wave, otherwise it uses the audio device's sample rate.

◆ IsPlaying()

bool USynthComponent::IsPlaying ( ) const

Returns true if this component is currently playing.

◆ IsReadyForOwnerToAutoDestroy()

bool USynthComponent::IsReadyForOwnerToAutoDestroy ( ) const
overridevirtual

◆ OnAudioComponentEnvelopeValue()

void USynthComponent::OnAudioComponentEnvelopeValue ( const UAudioComponent AudioComponent,
const USoundWave SoundWave,
const float  EnvelopeValue 
)

◆ OnBeginGenerate()

virtual void USynthComponent::OnBeginGenerate ( )
inlineprotectedvirtual

◆ OnEndGenerate()

virtual void USynthComponent::OnEndGenerate ( )
inlineprotectedvirtual

◆ OnGenerateAudio()

virtual int32 USynthComponent::OnGenerateAudio ( float OutAudio,
int32  NumSamples 
)
inlineprotectedvirtual

◆ OnGeneratePCMAudio()

int32 USynthComponent::OnGeneratePCMAudio ( float GeneratedPCMData,
int32  NumSamples 
)
protected

◆ OnRegister()

void USynthComponent::OnRegister ( )
overridevirtual

Reimplemented in UMediaSoundComponent.

◆ OnStart()

virtual void USynthComponent::OnStart ( )
inlineprotectedvirtual

◆ OnStop()

virtual void USynthComponent::OnStop ( )
inlineprotectedvirtual

◆ OnUnregister()

void USynthComponent::OnUnregister ( )
overridevirtual

Reimplemented in UMediaSoundComponent.

◆ RemoveAudioBufferListener()

AUDIOMIXER_API void USynthComponent::RemoveAudioBufferListener ( IAudioBufferListener InAudioBufferListener)

◆ Serialize()

void USynthComponent::Serialize ( FArchive Ar)
overridevirtual

◆ SetAudioBusSendPostEffect()

void USynthComponent::SetAudioBusSendPostEffect ( UAudioBus AudioBus,
float  AudioBusSendLevel 
)

Sets how much audio the sound should send to the given AudioBus (post effect).

◆ SetAudioBusSendPreEffect()

void USynthComponent::SetAudioBusSendPreEffect ( UAudioBus AudioBus,
float  AudioBusSendLevel 
)

Sets how much audio the sound should send to the given AudioBus (pre effect).

◆ SetLowPassFilterEnabled()

void USynthComponent::SetLowPassFilterEnabled ( bool  InLowPassFilterEnabled)

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

◆ SetLowPassFilterFrequency()

void USynthComponent::SetLowPassFilterFrequency ( float  InLowPassFilterFrequency)
virtual

Sets lowpass filter frequency of the audio component.

◆ SetModulationRouting()

void USynthComponent::SetModulationRouting ( const TSet< USoundModulatorBase * > &  Modulators,
const EModulationDestination  Destination,
const EModulationRouting  RoutingMethod = EModulationRouting::Inherit 
)

Sets the routing for one of the given Synth component's Modulation Destinations.

Parameters
ModulatorsThe set of modulators to apply to the given destination on the component.
DestinationThe destination to assign the modulators to.
RoutingMethodThe routing method to use for the given modulator.

◆ SetOutputToBusOnly()

void USynthComponent::SetOutputToBusOnly ( bool  bInOutputToBusOnly)

Sets whether or not the synth component outputs its audio to any source or audio buses.

◆ SetSourceBusSendPostEffect()

void USynthComponent::SetSourceBusSendPostEffect ( USoundSourceBus SoundSourceBus,
float  SourceBusSendLevel 
)

Sets how much audio the sound should send to the given SourceBus (post effect).

◆ SetSourceBusSendPreEffect()

void USynthComponent::SetSourceBusSendPreEffect ( USoundSourceBus SoundSourceBus,
float  SourceBusSendLevel 
)

Sets how much audio the sound should send to the given SourceBus (pre effect).

◆ SetSubmixSend()

void USynthComponent::SetSubmixSend ( USoundSubmixBase Submix,
float  SendLevel 
)

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

◆ SetVolumeMultiplier()

void USynthComponent::SetVolumeMultiplier ( float  VolumeMultiplier)

Set a new volume multiplier

◆ Start()

void USynthComponent::Start ( )

◆ Stop()

void USynthComponent::Stop ( )

◆ SynthCommand()

void USynthComponent::SynthCommand ( TFunction< void()>  Command)
protected

◆ UPARAM()

AUDIOMIXER_API USynthComponent::UPARAM ( DisplayName  = "Modulators") const

Gets the set of currently active modulators for a given Modulation Destination.

Parameters
DestinationThe Destination to retrieve the Modulators from.
Returns
The set of of Modulators applied to this component for the given Destination.

Friends And Related Symbol Documentation

◆ USynthSound

friend class USynthSound
friend

Member Data Documentation

◆ AttenuationOverrides

struct FSoundAttenuationSettings USynthComponent::AttenuationOverrides

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

◆ AttenuationSettings

TObjectPtr<class USoundAttenuation> USynthComponent::AttenuationSettings

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

◆ bAllowSpatialization

uint8 USynthComponent::bAllowSpatialization

Is this audio component allowed to be spatialized?

◆ bAlwaysPlay

uint8 USynthComponent::bAlwaysPlay

Whether to artificially prioritize the component to play

◆ bAutoDestroy

uint8 USynthComponent::bAutoDestroy

Auto destroy this component on completion

◆ bEnableBaseSubmix

uint32 USynthComponent::bEnableBaseSubmix

If enabled, sound will route to the Master Submix by default or to the Base Submix if defined. If disabled, sound will route ONLY to the Submix Sends and/or Bus Sends

◆ bEnableBusSends

uint32 USynthComponent::bEnableBusSends

Whether or not to enable sending this audio's output to buses.

◆ bEnableSubmixSends

uint32 USynthComponent::bEnableSubmixSends

Whether or not to enable Submix Sends other than the Base Submix.

◆ bIsPreviewSound

uint8 USynthComponent::bIsPreviewSound

Whether or not this synth is playing as a preview sound

◆ bIsUISound

uint8 USynthComponent::bIsUISound

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

◆ bOverrideAttenuation

uint8 USynthComponent::bOverrideAttenuation

Should the Attenuation Settings asset be used (false) or should the properties set directly on the component be used for attenuation properties

◆ bStopWhenOwnerDestroyed

uint8 USynthComponent::bStopWhenOwnerDestroyed

Stop sound when owner is destroyed

◆ BusSends

TArray<FSoundSourceBusSendInfo> USynthComponent::BusSends

This sound will send its audio output to this list of buses if there are bus instances playing after source effects are processed.

◆ ConcurrencySet

TSet<TObjectPtr<USoundConcurrency> > USynthComponent::ConcurrencySet

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

◆ ConcurrencySettings_DEPRECATED

TObjectPtr<USoundConcurrency> USynthComponent::ConcurrencySettings_DEPRECATED

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

◆ EnvelopeFollowerAttackTime

int32 USynthComponent::EnvelopeFollowerAttackTime

The attack time in milliseconds for the envelope follower. Delegate callbacks can be registered to get the envelope value of sounds played with this audio component. Only used in audio mixer.

◆ EnvelopeFollowerReleaseTime

int32 USynthComponent::EnvelopeFollowerReleaseTime

The release time in milliseconds for the envelope follower. Delegate callbacks can be registered to get the envelope value of sounds played with this audio component. Only used in audio mixer.

◆ ModulationRouting

FSoundModulationDefaultRoutingSettings USynthComponent::ModulationRouting

◆ NumChannels

int32 USynthComponent::NumChannels
protected

◆ OnAudioEnvelopeValue

FOnSynthEnvelopeValue USynthComponent::OnAudioEnvelopeValue

◆ OnAudioEnvelopeValueNative

FOnSynthEnvelopeValueNative USynthComponent::OnAudioEnvelopeValueNative

Shadow delegate for non UObject subscribers

◆ PreEffectBusSends

TArray<FSoundSourceBusSendInfo> USynthComponent::PreEffectBusSends

This sound will send its audio output to this list of buses if there are bus instances playing before source effects are processed.

◆ PreferredBufferLength

int32 USynthComponent::PreferredBufferLength
protected

◆ SoundClass

TObjectPtr<USoundClass> USynthComponent::SoundClass

Sound class this sound belongs to

◆ SoundSubmix

TObjectPtr<USoundSubmixBase> USynthComponent::SoundSubmix

Submix this sound belongs to

◆ SoundSubmixSends

TArray<FSoundSubmixSendInfo> USynthComponent::SoundSubmixSends

An array of submix sends. Audio from this sound will send a portion of its audio to these effects.

◆ SourceEffectChain

TObjectPtr<USoundEffectSourcePresetChain> USynthComponent::SourceEffectChain

The source effect chain to use for this sound.


The documentation for this class was generated from the following files: