-
Notifications
You must be signed in to change notification settings - Fork 29
/
partialDRC.ino
44 lines (36 loc) · 892 Bytes
/
partialDRC.ino
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
39
40
41
42
43
44
#include <btAudio.h>
btAudio audio = btAudio("ESP_Speaker");
String command;
void setup() {
// Streams audio data to the ESP32
audio.begin();
// Re-connects to last connected device
audio.reconnect();
// Outputs the received data to an I2S DAC, e.g. https://www.adafruit.com/product/3678
int bck = 26;
int ws = 27;
int dout = 25;
audio.I2S(bck, dout, ws);
// Opens the serial port
Serial.begin(115200);
}
float thresh=30;
float attack=0.1;
float release= 0.2;
float ratio = 10;
float width= 10;
float gain=0;
void loop() {
delay(300);
if(Serial.available()){
command = Serial.readStringUntil('#');
if(command.equals("compress")){
Serial.println("Applying Compression");
audio.compress(thresh,attack,release,ratio,width,gain);
}
else if(command.equals("decompress")){
Serial.println("Releasing Compression");
audio.decompress();
}
}
}