UAudioComponent::AdjustVolume
#include "Components/AudioComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Smoothly ramps the sound instance's playback volume to a new level over a given duration, using the chosen fade curve. Useful for gradual volume changes without abrupt pops.
Caveats & Gotchas
- • Passing an AdjustVolumeDuration of 0 applies the new volume immediately, equivalent to a hard SetVolumeMultiplier-style jump.
- • This adjusts the runtime playback volume ramp, not the persistent VolumeMultiplier property — repeated calls stack on top of the current interpolation rather than replacing the base multiplier.
- • Has no audible effect if the component isn't currently playing; it doesn't start playback.
Signature
void AdjustVolume(float AdjustVolumeDuration, float AdjustVolumeLevel, const EAudioFaderCurve FadeCurve = EAudioFaderCurve::Linear) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| AdjustVolumeDuration | float | Length of time, in seconds, to interpolate between the current volume and the new volume. | — |
| AdjustVolumeLevel | float | The target volume to reach at the end of the interpolation. | — |
| FadeCurve | EAudioFaderCurve | The curve shape used while interpolating between volumes. | EAudioFaderCurve::Linear |
Return Type
void Example
Fade out over 2 seconds C++
AudioComponent->AdjustVolume(2.0f, 0.0f, EAudioFaderCurve::Logarithmic); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?