@@ -81,8 +81,7 @@ namespace MozziPrivate {
81
81
size_t bytes_written;
82
82
// i2s_write(i2s_num, &_esp32_prev_sample, ESP_SAMPLE_SIZE, &bytes_written, 0);
83
83
#if MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_I2S_DAC) || MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_PDM_VIA_I2S)
84
- i2s_channel_write (tx_handle,&_esp32_prev_sample, ESP_SAMPLE_SIZE, &bytes_written, 0 );
85
-
84
+ i2s_channel_write (tx_handle,_esp32_prev_sample, sizeof (_esp32_prev_sample[0 ]), &bytes_written, 0 );// TODO STEREO
86
85
#elif MOZZI_IS(MOZZI_AUDIO_MODE, MOZZI_OUTPUT_INTERNAL_DAC)
87
86
dac_continuous_write (dac_handle, _esp32_prev_sample, ESP_SAMPLE_SIZE, &bytes_written, 0 );
88
87
/* uint8_t tt = 120;
@@ -97,7 +96,6 @@ namespace MozziPrivate {
97
96
inline bool canBufferAudioOutput () {
98
97
if (_esp32_can_buffer_next) return true ;
99
98
_esp32_can_buffer_next = esp32_tryWriteSample ();
100
- // if(_esp32_can_buffer_next) digitalWrite(2,!digitalRead(2));
101
99
return _esp32_can_buffer_next;
102
100
}
103
101
@@ -171,17 +169,18 @@ namespace MozziPrivate {
171
169
// static const i2s_config_t i2s_config = {
172
170
i2s_std_config_t std_cfg = {
173
171
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG (MOZZI_AUDIO_RATE),
174
- .slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG (ESP_SAMPLE_SIZE, I2S_SLOT_MODE_STEREO), // TODO: add between the different modes?
172
+ .slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG (ESP_SAMPLE_SIZE, I2S_SLOT_MODE_MONO), // TODO: add between the different modes? AND STEREO
173
+ // .slot_cfg = I2S_STD_PHILIPS_SLOT_DEFAULT_CONFIG(ESP_SAMPLE_SIZE, I2S_SLOT_MODE_MONO),
175
174
.gpio_cfg = {
176
- .mclk = I2S_GPIO_UNUSED ,
175
+ .mclk = gpio_num_t (MOZZI_I2S_PIN_MCLK) ,
177
176
.bclk = gpio_num_t (MOZZI_I2S_PIN_BCK),
178
177
.ws = gpio_num_t (MOZZI_I2S_PIN_WS),
179
178
.dout = gpio_num_t (MOZZI_I2S_PIN_DATA),
180
179
.din = I2S_GPIO_UNUSED,
181
180
.invert_flags = {
182
181
.mclk_inv = false ,
183
182
.bclk_inv = false ,
184
- .ws_inv = false ,
183
+ .ws_inv = true ,
185
184
},
186
185
},
187
186
0 commit comments