You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-88398 #rb ethan.geller #ROBOMERGE-SOURCE: CL 11313391 via CL 11316150 #ROBOMERGE-BOT: (v653-11302973) [CL 11316302 by phil popp in Main branch]
56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "DSP/Filter.h"
|
|
|
|
namespace Audio
|
|
{
|
|
// Equalizer filter
|
|
// An equalizer is a cascaded (serial) band of parametric EQs
|
|
// This filter allows for setting each band with variable Bandwidth/Q, Frequency, and Gain
|
|
class SIGNALPROCESSING_API FEqualizer
|
|
{
|
|
public:
|
|
// Constructor
|
|
FEqualizer();
|
|
|
|
// Destructor
|
|
~FEqualizer();
|
|
|
|
// Initialize the equalizer
|
|
void Init(const float InSampleRate, const int32 InNumBands, const int32 InNumChannels);
|
|
|
|
// Sets whether or not the band is enabled
|
|
void SetBandEnabled(const int32 InBand, const bool bEnabled);
|
|
|
|
// Sets all params of the band at once
|
|
void SetBandParams(const int32 InBand, const float InFrequency, const float InBandwidth, const float InGainDB);
|
|
|
|
// Sets the band frequency
|
|
void SetBandFrequency(const int32 InBand, const float InFrequency);
|
|
|
|
// Sets the band resonance (use alternatively to bandwidth)
|
|
void SetBandBandwidth(const int32 InBand, const float InBandwidth);
|
|
|
|
// Sets the band gain in decibels
|
|
void SetBandGainDB(const int32 InBand, const float InGainDB);
|
|
|
|
// Processes the audio frame (audio frame must have channels equal to that used during initialization)
|
|
void ProcessAudioFrame(const float* InAudio, float* OutAudio);
|
|
|
|
private:
|
|
|
|
// The number of channels in the equalizer
|
|
int32 NumChannels;
|
|
|
|
// The array of biquad filters
|
|
TArray<FBiquadFilter> FilterBands;
|
|
|
|
// Temporary array for processing audio.
|
|
TArray<float> WorkBuffer;
|
|
};
|
|
|
|
}
|