implement new audio engine
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include "AudioBuffer.h"
|
||||
|
||||
namespace engine {
|
||||
|
||||
class EqProcessor {
|
||||
public:
|
||||
static constexpr int BANDS = 10;
|
||||
static constexpr float FREQS[BANDS] = {
|
||||
32, 64, 125, 250, 500, 1000, 2000, 4000, 8000, 16000
|
||||
};
|
||||
|
||||
EqProcessor();
|
||||
|
||||
void setBand(int band, float dB);
|
||||
float band(int band) const;
|
||||
|
||||
void process(AudioBuffer &buf);
|
||||
|
||||
void reset();
|
||||
|
||||
void setSampleRate(int sr);
|
||||
|
||||
private:
|
||||
void recomputeBiquad(int band);
|
||||
|
||||
int m_sampleRate { 44100 };
|
||||
float m_gainDb[BANDS] {};
|
||||
|
||||
float m_coeff[BANDS][5] {};
|
||||
|
||||
static constexpr int MAX_CH = 8;
|
||||
float m_state[BANDS][MAX_CH][2] {};
|
||||
};
|
||||
|
||||
} // namespace engine
|
||||
Reference in New Issue
Block a user