Mozzi  version v1.1.0
sound synthesis library for Arduino
AudioConfigESP.h
1 #ifndef AUDIOCONFIGESP_H
2 #define AUDIOCONFIGESP_H
3 
4 #if not IS_ESP8266()
5 #error This header should be included for ESP architecture, only
6 #endif
7 
8 // AUDIO output modes. See README.md
9 #define PDM_VIA_I2S 1
10 #define PDM_VIA_SERIAL 2
11 #define EXTERNAL_DAC_VIA_I2S 3 // output via external DAC connected to I2S (PT8211 or similar)
12 
13 //******* BEGIN: These are the defines you may want to change. Best not to touch anything outside this range. ************/
14 #define ESP_AUDIO_OUT_MODE PDM_VIA_SERIAL
15 #define PDM_RESOLUTION 2 // 1 corresponds to 32 PDM clocks per sample, 2 corresponds to 64 PDM clocks, etc. (and at some level you're going hit the hardware limits)
16 //******* END: These are the defines you may want to change. Best not to touch anything outside this range. ************/
17 
19 #define PDM_RESOLUTION 1 // DO NOT CHANGE THIS VALUE! Not actually PDM coded, but this define is useful to keep code simple.
20 #endif
21 
22 #if (AUDIO_MODE == HIFI)
23 #error HIFI mode is not available for this CPU architecture (but check ESP_AUDIO_OUT_MODE, and PDM_RESOLUTION)
24 #endif
25 
26 #if (AUDIO_CHANNELS > 1)
27 #if (ESP_AUDIO_OUT_MODE != EXTERNAL_DAC_VIA_I2S)
28 #error Stereo is not available for the configured audio output mode
29 #endif
30 #endif
31 
33 // NOTE: On ESP / output via I2S, we simply use the I2S buffer as the output
34 // buffer, which saves RAM, but also simplifies things a lot
35 // esp. since i2s output already has output rate control -> no need for a
36 // separate output timer
37 #define BYPASS_MOZZI_OUTPUT_BUFFER true
38 #endif
39 
40 #define AUDIO_BITS 16
41 #define AUDIO_BIAS ((uint16_t) 1<<(AUDIO_BITS-1))
42 
43 #endif // #ifndef AUDIOCONFIGESP_H
#define PDM_VIA_SERIAL
#define ESP_AUDIO_OUT_MODE
#define AUDIO_BITS
Definition: MozziGuts.h:228
#define EXTERNAL_DAC_VIA_I2S