Skip to content
HELIX is in Early Access Preview. Some features and documentation may be non-functional or out of date.

Sound

The Sound class provides a high-level interface for playing and controlling both 2D and 3D audio in-game. It allows you to spawn sounds at specific locations, adjust playback properties such as volume, pitch, and attenuation, and apply effects like fading, filtering, and modulation. The class also exposes functions for querying playback state, retrieving audio analysis data (such as FFT and envelope data), and customizing audio routing and parameters.

Constructor#

Example
local SoundActor = Sound(
    Vector(-7940, 7402, 150),
    '/Engine/VREditor/Sounds/UI/Enter_Play',
    false,
    false,
    1.0,
    1.0,
    400,
    600,
    AttenuationFunction.Linear,
    true
)
print(SoundActor.Object) -- AActor
print(SoundActor.Component) -- UAudioComponent
Type Name Default Description
Vector Location The location to spawn the decal at.
string SoundAsset The path to a USoundBase asset.
boolean? bIs2D true Whether the sound is to be 2D sound, or a 3D sound.
boolean bAutoDestroy Whether to automatically destroy the component once the sound has finished playing.
number Volume The volume multiplier the sound will play at.
number Pitch The pitch multiplier applied to the sound.
number Radius The inner radius for sound attenuation.
number FalloffDistance The falloff distance for sound attenuation.
AttenuationFunction NOTE: Needs Enum AttenuationFunction The attenuation function enum to use for sound attenuation.

Functions#

Play#

Starts playing the targeted audio component’s sound.

  • startTime: number - Time offset (in seconds) to begin playback from
Example
SoundActor:Play(30)

Stop#

Stops the audio component’s sound immediately and issues any relevant delegates.

Example
SoundActor:Stop()

StopDelayed#

Cues a stop request after a given delay (in seconds). Stops immediately if DelayTime <= 0.

  • delayTime: number - Delay before stopping the sound
Example
SoundActor:StopDelayed(delayTime)

FadeIn#

Fades the sound in over a duration with optional volume curve

  • FadeInDuration: number — Duration of the fade-in.
  • FadeVolumeLevel: number (default: 1.0) — Target volume level.
  • StartTime: number (default: 0) — Optional start time offset in seconds.
  • FadeCurve: EAudioFaderCurve (default: Linear) — Curve shape used for fading.
Example
SoundActor:FadeIn(FadeInDuration, FadeVolumeLevel, StartTime, FadeCurve)

FadeOut#

Fades the sound out over a duration with optional volume curve

  • FadeOutDuration: number - duration of fade-out
  • FadeVolumeLevel: number - final volume level (default: 0)
  • FadeCurve: EAudioFaderCurve — curve shape used for fading
Example
SoundActor:FadeOut(FadeOutDuration, FadeVolumeLevel, FadeCurve)

SetPaused#

Pauses or resumes the audio component’s playback

  • bPause: boolean
Example
SoundActor:SetPaused(bPause)

SetVolumeMultiplier#

Sets a new global volume multiplier for the sound

  • NewVolumeMultiplier: number
Example
SoundActor:SetVolumeMultiplier(NewVolumeMultiplier)

SetPitchMultiplier#

Sets a new pitch multiplier for the sound

  • NewPitchMultiplier: number - Multiplier for playback pitch (e.g., 1.0 is normal pitch)
Example
SoundActor:SetPitchMultiplier(NewPitchMultiplier)

SetUISound#

Marks the sound as UI sound (used for mixing purposes)

  • bInUISound: boolean - Whether this sound should be treated as a UI sound
Example
SoundActor:SetUISound(bInUISound)

SetSound#

Changes the sound asset being played by the component

Example
SoundActor:SetSound(NewSound)

SetLowPassFilterEnabled#

Enables/disables a low-pass filter for this sound

  • InLowPassFilterEnabled: boolean - Whether the LPF is enabled
Example
SoundActor:SetLowPassFilterEnabled(InLowPassFilterEnabled)

SetLowPassFilterFrequency#

Sets the cutoff frequency (Hz) for the low-pass filter

  • InLowPassFilterFrequency: number - Frequency threshold for LPF (in Hz)
Example
SoundActor:SetLowPassFilterFrequency(InLowPassFilterFrequency)

SetHighPassFilterEnabled#

Enables/disables a high-pass filter for this sound

  • InHighPassFilterEnabled: boolean - Whether the HPF is enabled
Example
SoundActor:SetHighPassFilterEnabled(InHighPassFilterEnabled)

SetHighPassFilterFrequency#

Sets the cutoff frequency (Hz) for the high-pass filter

  • InHighPassFilterFrequency: number - Frequency threshold for HPF (in Hz)
Example
SoundActor:SetHighPassFilterFrequency(InHighPassFilterFrequency)

SetSubmixSend#

Sets the send level to a specific submix

Example
SoundActor:SetSubmixSend(Submix, SendLevel)

SetAudioBusSendPreEffect#

Sets how much audio is sent to an Audio Bus before source effects

  • AudioBus: UAudioBus - Audio bus to send to pre-effects
  • AudioBusSendLevel: number - Volume level of the send
Example
SoundActor:SetAudioBusSendPreEffect(AudioBus, AudioBusSendLevel)

SetAudioBusSendPostEffect#

Sets how much audio is sent to an Audio Bus after source effects

  • AudioBus: UAudioBus - Audio bus to send to pre-effects
  • AudioBusSendLevel: number - Volume level of the send
Example
SoundActor:SetAudioBusSendPostEffect(AudioBus, AudioBusSendLevel)

SetSourceBusSendPreEffect#

Sets the send level to a Source Bus before effect processing

  • SoundSourceBus: USoundSourceBus - Source bus to send to pre-effects
  • SourceBusSendLevel: number - Volume level of the send
Example
SoundActor:SetSourceBusSendPreEffect(SoundSourceBus, SourceBusSendLevel)

SetSourceBusSendPostEffect#

Sets the send level to a Source Bus after effect processing

  • SoundSourceBus: USoundSourceBus - Source bus to send to pre-effects
  • SourceBusSendLevel: number - Volume level of the send
Example
SoundActor:SetSourceBusSendPostEffect(SoundSourceBus, SourceBusSendLevel)

AdjustVolume#

Adjusts the playback volume smoothly over time using a curve

  • AdjustVolumeDuration: number - Time to reach the target volume
  • AdjustVolumeLevel: number - Target volume level
  • FadeCurve: EAudioFaderCurve - Curve used for adjustment
Example
SoundActor:AdjustVolume(AdjustVolumeDuration, AdjustVolumeLevel, FadeCurve)

IsPlaying#

Returns whether the sound is currently playing

  • returns: boolean
Example
local bPlaying = SoundActor:IsPlaying()

IsVirtualized#

Returns whether the sound is virtualized (paused due to distance or other factors)

  • returns: boolean
Example
local bVirtualized = SoundActor:IsVirtualized()

GetPlayState#

Returns the current play state of the audio component

Example
local playState = SoundActor:GetPlayState()

HasCookedFFTData#

Checks if the current sound has precomputed FFT data available

  • returns: boolean
Example
local hCookedF = SoundActor:HasCookedFFTData()

HasCookedAmplitudeEnvelopeData#

Checks if the current sound has amplitude envelope data

  • returns: boolean
Example
local hCookedA = SoundActor:HasCookedAmplitudeEnvelopeData()

GetCookedEnvelopeDataForAllPlayingSounds#

Gets the current-time amplitude envelope data of the sounds playing on the audio component. Envelope data is not averaged or interpolated. Instead an array of data with all playing sound waves with cooked data is returned.

  • returns: boolean | TArray

Example
local OutEnvelopeData = UE.TArray()
local DataFound = SoundActor:GetCookedEnvelopeDataForAllPlayingSounds(OutEnvelopeData)
OR

Example
local DataFound, OutEnvelopeData = SoundActor:GetCookedEnvelopeDataForAllPlayingSounds(OutEnvelopeData)

GetCookedEnvelopeData#

Gets the current amplitude envelope value of the sound

  • OutEnvelopeData: number - Output variable for the current envelope value
  • returns: boolean
Example
local gCookedE = SoundActor:GetCookedEnvelopeData(OutEnvelopeData)

GetCookedFFTDataForAllPlayingSounds#

Gets the current-time cooked spectral data of the sounds playing on the audio component. Spectral data is not averaged or interpolated. Instead an array of data with all playing sound waves with cooked data is returned.

  • returns: boolean | TArray

Example
local OutSoundWaveSpectralData = UE.TArray()
local DataFound = SoundActor:GetCookedFFTDataForAllPlayingSounds(OutEnvelopeData)
OR

Example
local DataFound, OutEnvelopeData = SoundActor:GetCookedFFTDataForAllPlayingSounds(OutEnvelopeData)

GetCookedFFTData#

Gets the spectral FFT data for specified frequencies

  • FrequenciesToGet: TArray - List of frequencies to retrieve data for
  • OutSoundWaveSpectralData: TArray - Output array for spectral data
  • returns: boolean
Example
SoundActor:GetCookedFFTData(FrequenciesToGet, OutSoundWaveSpectralData)

SetIntParameter#

Sets a named integer parameter on the sound

  • InName: string - Name of the parameter
  • InInt: integer - Value to set
Example
SoundActor:SetIntParameter(InName, InInt)

SetFloatParameter#

Sets a named float parameter on the sound

  • InName: string - Name of the parameter
  • InFloat: number - Value to set
Example
SoundActor:SetFloatParameter(InName, InFloat)

SetBoolParameter#

Sets a named boolean parameter on the sound

  • InName: string - Name of the parameter
  • InBool: boolean - Value to set
Example
SoundActor:SetBoolParameter(InName, InBool)

SetWaveParameter#

Sets a named wave parameter on the sound

  • InName: string - Name of the parameter
  • InWave: USoundWave - Wave to assign
Example
SoundActor:SetWaveParameter(InName, InWave)

SetAttenuationSettings#

Sets the attenuation settings for the sound

  • InAttenuationSettings: USoundAttenuation - The sound attenuation instance used to be set
Example
SoundActor:SetAttenuationSettings(InAttenuationSettings)

SetAttenuationOverrides#

Sets the attenuation settings for the sound by overriding

  • InAttenuationSettings: FSoundAttenuationSettings - The sound attenuation structure used to override the attenuation settings
Example
SoundActor:SetAttenuationOverrides(InAttenuationSettings)

AdjustAttenuation#

Modifies the attenuation settings on the component

Example
SoundActor:AdjustAttenuation(InAttenuationSettings)

BP_GetAttenuationSettingsToApply#

Retrieves the current attenuation settings applied to the sound

Example
local success = SoundActor:BP_GetAttenuationSettingsToApply(OutAttenuationSettings)

SetOutputToBusOnly#

Controls whether the audio is output only to the bus

  • bInOutputToBusOnly: boolean - Whether to route output only to the bus
Example
SoundActor:SetOutputToBusOnly(bInOutputToBusOnly)

SetOverrideAttenuation#

Overrides the default attenuation behavior

  • bInOverrideAttenuation: boolean - Whether to override attenuation settings
Example
SoundActor:SetOverrideAttenuation(bInOverrideAttenuation)

SetModulationRouting#

Sets modulation routing for a destination

Example
SoundActor:SetModulationRouting(Modulators, Destination, RoutingMethod)

AddModulationRouting#

Adds modulators to existing modulation routing

Example
SoundActor:AddModulationRouting(Modulators, Destination)

RemoveModulationRouting#

Removes modulators from existing routing

Example
SoundActor:RemoveModulationRouting(Modulators, Destination)

GetModulators#

Gets active modulators for a given modulation destination

Example
SoundActor:GetModulators(Destination)

PlayQuantized#

Plays the sound aligned to a quantization boundary using a clock handle

  • WorldContextObject: UObject - Context object, for example the world.
  • InClockHandle: UQuartzClockHandle - Handle to the clock.
  • InQuantizationBoundary: FQuartzQuantizationBoundary - Quantization boundary.
  • InDelegate: Delegate - Delegate to call on completion.
  • InStartTime: number (default: 0) - Optional start time.
  • InFadeInDuration: number (default: 0) - Fade-in duration.
  • InFadeVolumeLevel: number (default: 1.0) - Target volume.
  • InFadeCurve: EAudioFaderCurve (default: Linear) - Fade curve.
Example
SoundActor:PlayQuantized(WorldContextObject, InClockHandle, InQuantizationBoundary, InDelegate, InStartTime, InFadeInDuration, InFadeVolumeLevel, InFadeCurve)