forked from ezio84/abc_packages_apps_DSPlibs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EffectEqualizer.h
37 lines (28 loc) · 941 Bytes
/
EffectEqualizer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include <audio_effects/effect_equalizer.h>
#include "Biquad.h"
#include "Effect.h"
#define CUSTOM_EQ_PARAM_LOUDNESS_CORRECTION 1000
class EffectEqualizer : public Effect {
private:
float mBand[6];
Biquad mFilterL[5], mFilterR[5];
/* Automatic equalizer */
float mLoudnessAdjustment;
float mLoudnessL;
float mLoudnessR;
int32_t mNextUpdate;
int32_t mNextUpdateInterval;
int64_t mPowerSquaredL;
int64_t mPowerSquaredR;
/* Smooth enable/disable */
int32_t mFade;
void setBand(int32_t idx, float dB);
float getAdjustedBand(int32_t idx, float loudness);
void refreshBands();
void updateLoudnessEstimate(float& loudness, int64_t powerSquared);
public:
EffectEqualizer();
int32_t command(uint32_t cmdCode, uint32_t cmdSize, void* pCmdData, uint32_t* replySize, void* pReplyData);
int32_t process(audio_buffer_t *in, audio_buffer_t *out);
};