M5 Atom Echo - i2s PDM to RTSP #1597
-
Hi everyone, I'm currently working on a project with the M5 Atom Echo module, aiming to create an RTSP microphone for home automation and conversational agents. I've already explored the ESPHome examples, but I'm specifically interested in using RTSP for internal development. Below is the current code I'm using: #include "AudioTools.h"
AudioWAVServer server("SSID","MDP"); // the same as above
I2SStream i2sStream; // Access I2S as stream
ConverterFillLeftAndRight<int16_t> filler(LeftIsEmpty); // fill both channels - or change to RightIsEmpty
void setup(){
Serial.begin(115200);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
// start i2s input with default configuration
Serial.println("starting I2S...");
auto cfg = i2sStream.defaultConfig(RX_MODE);
cfg.bits_per_sample = 16;
cfg.channels = 1;
cfg.sample_rate = 44100;
cfg.signal_type = PDM;
//cfg.channel_format = I2S_CHANNEL_FMT_ALL_LEFT; // or left ?
cfg.use_apll = false;
cfg.auto_clear = false;
cfg.pin_ws = 33;
cfg.pin_data = 23;
i2sStream.begin(cfg);
Serial.println("I2S started");
// start data sink
server.begin(i2sStream, cfg, &filler);
}
// Arduino loop
void loop() {
// Handle new connections
server.copy();
} The code almost works, but I'm encountering an issue where the sound is slowed down and takes a significant amount of time to load. Any help or suggestions on how to resolve this issue would be greatly appreciated. Specifically, I'm looking for advice on the correct configuration for I2S PDM and any potential improvements to the RTSP streaming setup. Thank you in advance for your assistance! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I think this is just the regular buffering done by your browser. |
Beta Was this translation helpful? Give feedback.
-
I think it is probably not worth the effort and you will not be able to handle such a high sample rate. |
Beta Was this translation helpful? Give feedback.
I think this is just the regular buffering done by your browser.
The use of the ConverterFillLeftAndRight does not make any sense if you have an mono signal as input and outpu!