UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FoldbackDistortion.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 "DSP/Osc.h"
7
8namespace Audio
9{
10 // Foldback distortion effect
11 // https://en.wikipedia.org/wiki/Foldback_(power_supply_design)
13 {
14 public:
15 // Constructor
17
18 // Destructor
20
21 // Initialize the equalizer
23
24 // Sets the foldback distortion threshold
26
27 // Sets the input gain
29
30 // Sets the output gain
32
33 // Processes a single audio sample
35
36 // Processes a mono stream
37 SIGNALPROCESSING_API void ProcessAudioFrame(const float* InFrame, float* OutFrame);
38
39 // Processes a stereo stream
40 SIGNALPROCESSING_API void ProcessAudio(const float* InBuffer, const int32 InNumSamples, float* OutBuffer);
41
42 private:
43 // Threshold to check before folding audio back on itself
44 float Threshold;
45
46 // Threshold times 2
47 float Threshold2;
48
49 // Threshold time 4
50 float Threshold4;
51
52 // Input gain used to force hitting the threshold
53 float InputGain;
54
55 // A final gain scaler to apply to the output
56 float OutputGain;
57
58 // How many channels we expect the audio intput to be.
59 int32 NumChannels;
60 };
61
62}
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
void Init()
Definition LockFreeList.h:4
Definition FoldbackDistortion.h:13
SIGNALPROCESSING_API void ProcessAudioFrame(const float *InFrame, float *OutFrame)
Definition FoldbackDistortion.cpp:60
SIGNALPROCESSING_API void SetInputGainDb(const float InInputGainDb)
Definition FoldbackDistortion.cpp:33
SIGNALPROCESSING_API float ProcessAudioSample(const float InSample)
Definition FoldbackDistortion.cpp:43
SIGNALPROCESSING_API void SetOutputGainDb(const float InOutputGainDb)
Definition FoldbackDistortion.cpp:38
SIGNALPROCESSING_API ~FFoldbackDistortion()
Definition FoldbackDistortion.cpp:17
SIGNALPROCESSING_API void ProcessAudio(const float *InBuffer, const int32 InNumSamples, float *OutBuffer)
Definition FoldbackDistortion.cpp:68
SIGNALPROCESSING_API void SetThresholdDb(const float InThresholdDb)
Definition FoldbackDistortion.cpp:26
SIGNALPROCESSING_API FFoldbackDistortion()
Definition FoldbackDistortion.cpp:8
NO_LOGGING.
Definition AudioMixerPlatformAndroid.cpp:53