UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DynamicDelayAPF.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "IntegerDelay.h"
10
11namespace Audio
12{
13 // All Pass Filter with a long fractional delay which can be set per a sample. This filter is specifically designed for
14 // reverb applications where filter delay lines are long.
16 {
17 public:
18 // InG is the filter coefficient used in the long delay all pass filter.
19 // InMinDelay is the minimum allowable delay of the all pass filter.
20 // InMaxDelay is the maximum allowable delay of the all pass filter.
21 // InMaxNumInternalBufferSamples is the maximum internal block size used internally.
22 // InSampleRate is the current rendering sample rate. Used to convert parameter ease time from seconds to samples.
24
25 // Destructor
27
28 // Set the APF feedback/feedforward gain coefficient
29 void SetG(float InG)
30 {
31 G.SetValue(InG, EaseTimeInSec);
32 }
33
34 // Processes InSamples through the all pass filter and populates OutSamples with the filter output.
35 // InDelays denotes the per-sample delay of the allpass. It must have an equal number of elements as InSamples
37
38 // Zeros the internal delay line.
40
41 void SetEaseTimeInSec(float InEaseTimeInSec) { EaseTimeInSec = InEaseTimeInSec; }
42
43 protected:
44
45 // Process one block of audio.
47
48 private:
49 // Feedback/Feedforward gain coefficient
51 float EaseTimeInSec;
52 int32 MinDelay;
53 int32 MaxDelay;
54 int32 NumDelaySamples;
55 int32 NumInternalBufferSamples;
56
57 // Buffers for block processing
58 FAlignedFloatBuffer FractionalDelays;
59 FAlignedFloatBuffer DelayLineInput;
60 FAlignedFloatBuffer WorkBufferA;
61 FAlignedFloatBuffer WorkBufferB;
62
63 // Delay line memory.
64 TUniquePtr<FAlignedBlockBuffer> IntegerDelayLine;
66 };
67
68}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition DynamicDelayAPF.h:16
void SetG(float InG)
Definition DynamicDelayAPF.h:29
SIGNALPROCESSING_API void ProcessAudioBlock(const float *InSamples, const FAlignedFloatBuffer &InFractionalDelays, const int32 InNum, float *OutSamples)
Definition DynamicDelayAPF.cpp:94
SIGNALPROCESSING_API void Reset()
Definition DynamicDelayAPF.cpp:135
SIGNALPROCESSING_API ~FDynamicDelayAPF()
Definition DynamicDelayAPF.cpp:49
SIGNALPROCESSING_API void ProcessAudio(const FAlignedFloatBuffer &InSamples, const FAlignedFloatBuffer &InDelays, FAlignedFloatBuffer &OutSamples)
Definition DynamicDelayAPF.cpp:52
void SetEaseTimeInSec(float InEaseTimeInSec)
Definition DynamicDelayAPF.h:41
Definition Dsp.h:619
void SetValue(const float InValue, float InTimeSec=0.0f)
Definition Dsp.h:705
Definition UniquePtr.h:107
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53