forked from kran27/Spotiamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudio_eq.h
38 lines (30 loc) · 769 Bytes
/
audio_eq.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
38
#ifndef TINY_SPOTIFY_AUDIO_EQ_H_
#define TINY_SPOTIFY_AUDIO_EQ_H_
#include "config.h"
#include "types.h"
#include "tiny_spotify.h"
#if TSP_WITH_EQUALIZER
enum {
EQ_MAX_BANDS = 10,
EQ_CHANNELS = 2
};
typedef struct EqBand {
float A,B,G;
float y1,y2,x1,x2;
} EqBand;
typedef struct EqChannel {
float preamp;
float LX,LY;
EqBand bands[10];
} EqChannel;
typedef struct TspEqualizer {
int enable;
float preamp;
float coeffs[10];
int sample_rate;
EqChannel channels[2];
} TspEqualizer;
void TspEqualizerSetValues(TspEqualizer *te, int enable, float pregain, const float bands[10]);
void TspEqualizerProcess(TspEqualizer *te, int16 *data, int lengthx, TspSampleFormat *format);
#endif // TSP_WITH_EQUALIZER
#endif // TINY_SPOTIFY_AUDIO_EQ_H_