UAudioComponent::FadeIn
#include "Components/AudioComponent.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintCallable
Description
Starts the sound and ramps volume from 0 to FadeVolumeLevel over FadeInDuration seconds. Commonly used for ambient sounds and music intro transitions.
Signature
virtual void FadeIn(float FadeInDuration, float FadeVolumeLevel = 1.0f, float StartTime = 0.0f, const EAudioFaderCurve FadeCurve = EAudioFaderCurve::Linear) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| FadeInDuration | float | Duration in seconds over which volume ramps from 0 to FadeVolumeLevel. | — |
| FadeVolumeLevel | float | Target volume as a fraction of the component's calculated volume (0.0–1.0). | 1.0f |
| StartTime | float | Offset in seconds into the sound at which playback begins. | 0.0f |
| FadeCurve | EAudioFaderCurve | Interpolation curve shape: Linear, Logarithmic, SCurve, or Sin. | EAudioFaderCurve::Linear |
Return Type
void Caveats & Gotchas
- • FadeVolumeLevel is a multiplier on the component's already-calculated volume — it is not an absolute dB level.
- • Calling FadeIn on an already-playing sound restarts it from StartTime. To fade up from the current volume without restarting, use AdjustVolume() instead.
- • EAudioFaderCurve::Logarithmic feels more natural for music fades; Linear can sound abrupt at low volume levels.
Example
Fade in ambient music over 3 seconds C++
AmbientMusicComp->FadeIn(3.0f, 1.0f, 0.0f, EAudioFaderCurve::Logarithmic); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?