Mozzi  version v1.1.0
sound synthesis library for Arduino
AudioConfigESP32.h
1 #ifndef AUDIOCONFIGESP32_H
2 #define AUDIOCONFIGESP32_H
3 
4 #if not IS_ESP32()
5 #error This header should be included for ESP32 architecture, only
6 #endif
7 
8 #if (AUDIO_MODE == HIFI)
9 #error HIFI mode is not available for this CPU architecture (but check ESP32_AUDIO_OUT_MODE, and PDM_RESOLUTION)
10 #endif
11 
12 // Audio output options
13 #define INTERNAL_DAC 1 // output using internal DAC via I2S, output on pin 26
14 #define PT8211_DAC 2 // output using an external PT8211 DAC via I2S
15 #define PDM_VIA_I2S 3 // output PDM coded sample on the I2S data pin (pin 33, by default, configurable, below)
16 
17 // Set output mode
18 #define ESP32_AUDIO_OUT_MODE INTERNAL_DAC
19 
20 // For external I2S output, only: I2S_PINS
21 #define ESP32_I2S_BCK_PIN 26
22 #define ESP32_I2S_WS_PIN 25
23 #define ESP32_I2S_DATA_PIN 33
24 
25 #include <driver/i2s.h>
26 const i2s_port_t i2s_num = I2S_NUM_0;
27 /// User config end. Do not modify below this line
28 
30 #define AUDIO_BITS 8
31 #define PDM_RESOLUTION 1
32 #elif (ESP32_AUDIO_OUT_MODE == PT8211_DAC)
33 #define AUDIO_BITS 16
34 #define PDM_RESOLUTION 1
35 #elif (ESP32_AUDIO_OUT_MODE == PDM_VIA_I2S)
36 #define AUDIO_BITS 16
37 #define PDM_RESOLUTION 4
38 #else
39 #error Invalid output mode configured in AudioConfigESP32.h
40 #endif
41 
42 #define AUDIO_BIAS ((uint16_t) 1<<(AUDIO_BITS-1))
43 #define BYPASS_MOZZI_OUTPUT_BUFFER true
44 
45 #endif // #ifndef AUDIOCONFIGESP_H
#define INTERNAL_DAC
#define AUDIO_BITS
Definition: MozziGuts.h:228
#define ESP32_AUDIO_OUT_MODE