3 ms·
I'd love a hardware device that streamed the audio to an HTTP endpoint of my choosing, and played back whatever audio I sent. I can handle the rest myself, but
by stavros 2y ago
I'd love a hardware device that streamed the audio to an HTTP endpoint of my choosing, and played back whatever audio I sent. I can handle the rest myself, but the hardware side is tricky.
- zq2240 2y agoHi, you can check out this: https://www.youtube.com/watch?v=qq2FRv0lCPw https://www.youtube.com/watch?v=qq2FRv0lCPw. I think it might be useful to you
- stavros 2y agoThis is great, thank you!
- akadeb 2y agoNeat! How can I help you? I think our devkit's components will help you get started. Here is the main.cpp code for this ``` /* * @file streams-i2s-webserver_wav.ino * * This sketch reads sound data from I2S. The result is provided as WAV stream which can be listened to in a Web Browser * * @author Phil Schatzmann * @copyright GPLv3 / #include <WiFi.h> #include "AudioTools.h" const char ssid = "<stavros_ssid>"; const char *password = "stavros_pw"; AudioWAVServer server(ssid, password); I2SStream i2sStream; ConverterFillLeftAndRight<int16_t> filler(LeftIsEmpty); // fill both channels - or change to RightIsEmpty void setup() { Serial.begin(115200); AudioLogger::instance().begin(Serial, AudioLogger::Info); // // Connect to Wi-Fi Serial.println("Connecting to WiFi..."); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting..."); } Serial.println("Connected to WiFi"); // Print the IP address Serial.print("IP address: "); Serial.println(WiFi.localIP()); // start i2s input with default configuration Serial.println("starting I2S..."); auto config = i2sStream.defaultConfig(RX_MODE); // working well config.i2s_format = I2S_STD_FORMAT; config.sample_rate = 44100; // INMP441 supports up to 44.1kHz config.channels = 1; // INMP441 is mono config.bits_per_sample = 16; // INMP441 is a 24-bit ADC config.pin_ws = 19; // Adjust these pins according to your wiring config.pin_bck = 18; config.pin_data = 21; config.use_apll = true; // Try with APLL for better clock stability i2sStream.begin(config); Serial.println("I2S started"); // start data sink server.begin(i2sStream, config, &filler); } // Arduino loop void loop() { // Handle new connections server.copy(); } ``` This code just listens to audio you record on a microphone (INMP441 MEMS microphone used here) and streams it to an endpoint of the microcontroller's IP address. If you would like more help on this give me a shout anytime. my email: akash at starmoon dot app
- stavros 2y agoThis is good, thanks! Now that I see this, I realize that I'd want wakeword detection as well, which is getting a bit far. I like what the Willow team did with their stack, unfortunately that project seems to have died. It was pretty ideal, otherwise...
- zombot 2y agoI swear, every last bit of exchange from the "project developers" in this comment section, and all of the project repo, including the readme, is LLM-generated.
- akadeb 2y agoWe are all LLM-generated