UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AudioMixerSubmixEffectReverb.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "AudioEffect.h"
6#include "Curves/RichCurve.h"
7#include "AudioEffect.h"
8#include "Curves/RichCurve.h"
9#include "DSP/Amp.h"
10#include "DSP/ReverbFast.h"
13#include "Stats/Stats.h"
14
15#include "AudioMixerSubmixEffectReverb.generated.h"
16
18
19// The time it takes to process the master reverb.
21
22USTRUCT(BlueprintType)
24{
26
27
28 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = EarlyReflections)
29 bool bBypassEarlyReflections = false;
30
32 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = EarlyReflections, meta = (DisplayName = "Reflections Delay (seconds)", ClampMin = "0.0", ClampMax = "0.3", EditCondition = "!bBypass && !bBypassEarlyReflections"))
33 float ReflectionsDelay = 0.007f;
34
36 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = EarlyReflections, meta = (DisplayName = "High Frequency Gain", ClampMin = "0.0", ClampMax = "1.0", EditCondition = "!bBypass && !bBypassEarlyReflections"))
37 float GainHF = 0.89f;
38
40 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = EarlyReflections, meta = (ClampMin = "0.0", ClampMax = "3.16", EditCondition = "!bBypass && !bBypassEarlyReflections"))
41 float ReflectionsGain = 0.05f;
42
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections)
45 bool bBypassLateReflections = false;
46
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (DisplayName = "Late Delay (seconds)", ClampMin = "0.0", ClampMax = "0.1", EditCondition = "!bBypass && !bBypassLateReflections"))
49 float LateDelay = 0.1f;
50
52 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (DisplayName = "Decay Time (seconds)", ClampMin = "0.1", ClampMax = "20.0", EditCondition = "!bBypass && !bBypassLateReflections"))
53 float DecayTime = 1.49f;
54
56 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (ClampMin = "0.0", ClampMax = "1.0", EditCondition = "!bBypass && !bBypassLateReflections"))
57 float Density = 0.85f;
58
60 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (ClampMin = "0.0", ClampMax = "1.0", EditCondition = "!bBypass && !bBypassLateReflections"))
61 float Diffusion = 0.85f;
62
64 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (DisplayName = "High Frequency Air Absorption Gain", ClampMin = "0.0", ClampMax = "1.0", EditCondition = "!bBypass && !bBypassLateReflections"))
65 float AirAbsorptionGainHF = 0.994f;
66
68 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (DisplayName = "High Frequency Decay Ratio", ClampMin = "0.1", ClampMax = "2.0", EditCondition = "!bBypass && !bBypassLateReflections"))
69 float DecayHFRatio = 0.83f;
70
72 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (DisplayName = "Late Reflections Gain", ClampMin = "0.0", ClampMax = "10.0", EditCondition = "!bBypass && !bBypassLateReflections"))
73 float LateGain = 1.26f;
74
76 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = LateReflections, meta = (ClampMin = "0.0", ClampMax = "1.0", EditCondition = "!bBypass && !bBypassLateReflections"))
77 float Gain = 0.0f;
78
79 // Overall wet level of the reverb effect
80 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Routing, meta = (EditCondition = "!bBypass", UIMin = "0.0", UIMax = "1.0", ClampMin = "0.0", ClampMax = "10.0"))
81 float WetLevel = 0.3f;
82
83 // Overall dry level of the reverb effect
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Routing, meta = (EditCondition = "!bBypass", ClampMin = "0.0", ClampMax = "1.0"))
85 float DryLevel = 0.0f;
86
88 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = General)
89 bool bBypass = false;
90};
91
93{
94public:
96
97 // Called on an audio effect at initialization on main thread before audio processing begins.
98 AUDIOMIXER_API virtual void Init(const FSoundEffectSubmixInitData& InSampleRate) override;
99
100 // Called when an audio effect preset is changed
101 AUDIOMIXER_API virtual void OnPresetChanged() override;
102
103 // Forces receiving downmixed submix audio to stereo input for the reverb effect
104 virtual uint32 GetDesiredInputChannelCountOverride() const override { return 2; }
105
106 // Process the input block of audio. Called on audio thread.
107 AUDIOMIXER_API virtual void OnProcessAudio(const FSoundEffectSubmixInputData& InData, FSoundEffectSubmixOutputData& OutData) override;
108
109 // Sets the reverb effect parameters based from audio thread code
110 AUDIOMIXER_API virtual bool SetParameters(const FAudioEffectParameters& InParameters) override;
111
112 // Whether this effect supports the default reverb system
113 virtual bool SupportsDefaultReverb() const override
114 {
115 return true;
116 }
117
118 // Returns the drylevel of the effect
119 virtual float GetDryLevel() const override { return CurrentWetDry.DryLevel; }
120
121private:
122
123 static AUDIOMIXER_API const float MinWetness;
124 static AUDIOMIXER_API const float MaxWetness;
125
126 AUDIOMIXER_API void UpdateParameters();
127
128 // The reverb effect
130
131 // The reverb effect params
133
134 // Settings for wet and dry signal to be consumed on next buffer
136
137 // Level of wet/dry signal on current buffer
138 Audio::FWetDry CurrentWetDry;
139
140 Audio::FAlignedFloatBuffer WetInputBuffer;
141
142 // Curve which maps old reverb times to new decay value
143 FRichCurve DecayCurve;
144
145 float SampleRate = 1.f;
146};
147
148UCLASS(MinimalAPI)
150{
152
153public:
155
156 UFUNCTION(BlueprintCallable, Category = "Audio|Effects")
158
159 UFUNCTION(BlueprintCallable, Category = "Audio|Effects")
160 AUDIOMIXER_API void SetSettingsWithReverbEffect(const UReverbEffect* InReverbEffect, const float WetLevel, const float DryLevel = 0.0f);
161
162 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = SubmixEffectPreset, meta = (ShowOnlyInnerProperties))
164};
#define TEXT(x)
Definition Platform.h:1272
#define DECLARE_CYCLE_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:679
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
void Init()
Definition LockFreeList.h:4
@ General
Definition MaterialExpressionFunctionInput.h:41
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
#define EFFECT_PRESET_METHODS(EFFECT_NAME)
Definition SoundEffectBase.h:34
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Dsp.h:743
Definition SoundEffectSubmix.h:86
Definition AudioMixerSubmixEffectReverb.h:93
virtual float GetDryLevel() const override
Definition AudioMixerSubmixEffectReverb.h:119
virtual uint32 GetDesiredInputChannelCountOverride() const override
Definition AudioMixerSubmixEffectReverb.h:104
virtual bool SupportsDefaultReverb() const override
Definition AudioMixerSubmixEffectReverb.h:113
Definition UniquePtr.h:107
Definition ReverbEffect.h:13
Definition SoundEffectSubmix.h:26
Definition AudioMixerSubmixEffectReverb.h:150
@ false
Definition radaudio_common.h:23
Definition Amp.h:11
Definition SoundMix.h:18
Definition RichCurve.h:200
Definition SoundEffectSubmix.h:35
Definition SoundEffectSubmix.h:44
Definition SoundEffectSubmix.h:77
Definition AudioMixerSubmixEffectReverb.h:24