9 #include "ArdCommonOut.h"
11 #include "driver/i2s.h"
17 #define SAMPLE_RATE (36000)
19 #define I2S_BCK_IO (GPIO_NUM_13)
20 #define I2S_WS_IO (GPIO_NUM_15)
21 #define I2S_DO_IO (GPIO_NUM_21)
22 #define I2S_DI_IO (-1)
25 typedef int (*RtESPAudioCallback)(
void *outputBuffer,
29 static i2s_config_t default_i2s_config = {
30 .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN),
31 .sample_rate = SAMPLE_RATE,
32 .bits_per_sample = (i2s_bits_per_sample_t)
sizeof(stk::StkFloat),
33 .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
34 .communication_format = I2S_COMM_FORMAT_I2S_MSB,
35 .intr_alloc_flags = 0,
41 static i2s_pin_config_t default_pin_config = {
42 .bck_io_num = I2S_BCK_IO,
43 .ws_io_num = I2S_WS_IO,
44 .data_out_num = I2S_DO_IO,
45 .data_in_num = I2S_DI_IO
71 ArdI2SOut(
unsigned channels=1, i2s_port_t i2s_number=(i2s_port_t)0);
73 void setPinConfig(i2s_pin_config_t& pin_config);
74 void setI2SConfig(i2s_config_t& i2s_config);
78 i2s_config_t& i2s_config=default_i2s_config;
79 i2s_pin_config_t& pin_config = default_pin_config;
80 i2s_port_t i2s_number;
83 virtual void write(StkFloat value)
override;
84 virtual void write(int16_t value)
override;
STK Common Output for Arduiono.
Definition: ArdCommonOut.h:23
Output of sound to the I2S pins of the ESP32.
Definition: ArdI2SOut.h:69
The STK namespace.
Definition: ADSR.h:8