4 #include "AudioConfig.h"
8 #include "AudioTools/CoreAudio/AudioI2S/I2SConfig.h"
9 #include "AudioTools/CoreAudio/AudioI2S/I2SESP32.h"
10 #include "AudioTools/CoreAudio/AudioI2S/I2SESP32V1.h"
11 #include "AudioTools/CoreAudio/AudioI2S/I2SESP8266.h"
12 #include "AudioTools/CoreAudio/AudioI2S/I2SNanoSenseBLE.h"
13 #include "AudioTools/CoreAudio/AudioI2S/I2SRP2040-MBED.h"
14 #include "AudioTools/CoreAudio/AudioI2S/I2SRP2040.h"
15 #include "AudioTools/CoreAudio/AudioI2S/I2SSAMD.h"
16 #include "AudioTools/CoreAudio/AudioI2S/I2SSTM32.h"
17 #include "AudioTools/CoreAudio/AudioStreams.h"
18 #include "AudioTools/CoreAudio/AudioTypes.h"
20 #if defined(IS_I2S_IMPLEMENTED)
40 this->mute_pin = mute_pin;
42 pinMode(mute_pin, OUTPUT);
64 is_active = i2s.
begin(cfg);
77 is_active = i2s.
begin(cfg);
101 if (!info.
equals(current_cfg)) {
102 LOGI(
"restarting i2s");
103 info.logInfo(
"I2SStream");
106 i2s.
begin(current_cfg);
115 virtual size_t write(
const uint8_t *data,
size_t len) {
116 LOGD(
"I2SStream::write: %d", len);
117 if (data ==
nullptr || len == 0 || !is_active)
return 0;
122 virtual size_t readBytes(uint8_t *data,
size_t len)
override {
123 return i2s.readBytes(data, len);
132 void flush()
override {}
138 operator bool()
override {
return is_active; }
146 bool is_active =
false;
152 digitalWrite(mute_pin, is_mute ? SOFT_MUTE_VALUE : !SOFT_MUTE_VALUE);
RxTxMode
The Microcontroller is the Audio Source (TX_MODE) or Audio Sink (RX_MODE). RXTX_MODE is Source and Si...
Definition: AudioTypes.h:28