ESP32-audioI2S
freac
Our great sponsors
ESP32-audioI2S | freac | |
---|---|---|
14 | 90 | |
935 | 1,273 | |
- | - | |
9.3 | 7.8 | |
6 days ago | 27 days ago | |
C++ | C++ | |
GNU General Public License v3.0 only | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ESP32-audioI2S
-
Sound Module Suggestion
This library documentation has some more information on this... https://github.com/schreibfaul1/ESP32-audioI2S/wiki
- Trying to figure out how to play an audio file using a ESP32, this is our build, code in the comments. Any assistance?
-
Butting my head against extracting ID3 data and putting it into a JSON/Updating a Web Page
I'm using Audio.h, and have reverse engineered the library: https://github.com/schreibfaul1/ESP32-audioI2S/blob/master/src/Audio.cpp
-
The "while (Serial.available() > 0)" Block won't pickup on incoming messages sent from Arduino Uno despite them appearing on the Serial monitor.
#include #include // Initializes Library with numbers of the interface pins //LiquidCrystal lcd(5, 18, 19, 21, 22, 23); /* * LCD RS pin to digital pin 7 * LCD Enable pin to digital pin 8 * LCD D4 pin to digital pin 9 * LCD D5 pin to digital pin 10 * LCD D6 pin to digital pin 11 * LCD D7 pin to digital pin 12 * LCD R/W pin to ground * LCD VSS pin to ground * LCD VCC pin to 5V */ #include "Arduino.h" #include "WiFi.h" #include "Audio.h" #include "SD.h" #include "FS.h" // Digital I/O used #define SD_CS 5 #define SPI_MOSI 23 #define SPI_MISO 19 #define SPI_SCK 18 #define I2S_DOUT 25 #define I2S_BCLK 27 #define I2S_LRC 26 #define RXD2 16 #define TXD2 17 // == Radio Station Switching logic == int currentPotVal = 0; int previousPotVal = 0; bool stationOne = true; bool stationTwo = true; bool stationThree = true; bool stationFour = true; //String incomingData; Audio audio; String ssid = "3c1e044268dc"; String password = "5SDMUKLI2V34ALB7"; void setup() { //WiFi Setup pinMode(SD_CS, OUTPUT); digitalWrite(SD_CS, HIGH); SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI); Serial.begin(115200); Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); Serial.println("Serial Txd is on pin: "+String(TX)); Serial.println("Serial Rxd is on pin: "+String(RX)); ////////////////////////////////////////////////////// SD.begin(SD_CS); WiFi.disconnect(); WiFi.mode(WIFI_STA); WiFi.begin(ssid.c_str(), password.c_str()); while (WiFi.status() != WL_CONNECTED) delay(1500); audio.setPinout(I2S_BCLK, I2S_LRC, I2S_DOUT); audio.setVolume(21); // 0...21 // audio.connecttoFS(SD, "/320k_test.mp3"); // audio.connecttohost("http://www.wdr.de/wdrlive/media/einslive.m3u"); // audio.connecttohost("https://stream.srg-ssr.ch/rsp/aacp_48.asx"); // SWISS POP // audio.connecttohost("http://mp3.ffh.de/radioffh/hqlivestream.aac"); // 128k aac // Favorite 1 // audio.connecttohost("http://mp3.ffh.de/radioffh/hqlivestream.mp3"); // 128k mp3 // audio.connecttohost("https://github.com/schreibfaul1/ESP32-audioI2S/raw/master/additional_info/Testfiles/sample1.m4a"); // m4a // audio.connecttohost("https://github.com/schreibfaul1/ESP32-audioI2S/raw/master/additional_info/Testfiles/test_16bit_stereo.wav"); // wav // audio.connecttospeech("Wenn die Hunde schlafen, kann der Wolf gut Schafe stehlen.", "de"); audio.connecttohost("https://radio.streemlion.com/newwave"); //New Wave Station // audio.connecttohost("https://open.spotifycdn.com/cdn/build/web-player/vendor~web-player.2b906d15.js"); //Custom HTML delay(1200); } void loop() { while (Serial2.available()) { Serial.print(char(Serial2.read())); } while (Serial.available() > 0) { String message = Serial.readString(); if (message == "0250") { currentPotVal = 250; Serial.print("currentPotVal: "); Serial.println(currentPotVal); } if (message == "0500") { currentPotVal = 500; Serial.print("currentPotVal: "); Serial.println(currentPotVal); } if (message == "0750") { currentPotVal = 750; Serial.print("currentPotVal: "); Serial.println(currentPotVal); } if (message) == "1000") { currentPotVal = 1000; Serial.print("currentPotVal: "); Serial.println(currentPotVal); } } // == Station Switching == if (currentPotVal != previousPotVal) { if (currentPotVal == 250 && stationOne == true) { Serial.print("The Value is in between 0 and 250: "); Serial.println(currentPotVal); audio.connecttohost("https://radio.streemlion.com/newwave"); stationOne = false; stationTwo = true; stationThree = true; stationFour = true; delay(1200); } else if (currentPotVal == 500 && stationTwo == true) { Serial.print("The Value is in between 251 and 500: "); Serial.println(currentPotVal); audio.connecttohost("http://mp3.ffh.de/radioffh/hqlivestream.aac"); stationOne = true; stationTwo = false; stationThree = true; stationFour = true; delay(1200); } else if (currentPotVal == 750 && stationThree == true) { Serial.print("The Value is in between 501 and 750: "); Serial.println(currentPotVal); audio.connecttohost("http://mp3.ffh.de/radioffh/hqlivestream.mp3"); stationOne = true; stationTwo = true; stationThree = false; stationFour = true; delay(1200); } else if (currentPotVal == 1000 && stationFour == true) { Serial.print("The Value is in between 751 and 1023: "); Serial.println(currentPotVal); audio.connecttohost("https://github.com/schreibfaul1/ESP32-audioI2S/raw/master/additional_info/Testfiles/test_16bit_stereo.wav"); stationOne = true; stationTwo = true; stationThree = true; stationFour = false; delay(1200); } previousPotVal = currentPotVal; } audio.loop(); //Serial.print("======="); //Serial.println(currentPotVal); Serial.print("Current Pot Val: "); //Serial.println(previousPotVal); Serial.print("PREVIOUS POT VAL: "); } // Radio Station Serial Monitor Info void audio_info(const char *info){ //Serial.print("info "); Serial.println(info); } void audio_id3data(const char *info){ //id3 metadata Serial.print("id3data ");Serial.println(info); } void audio_eof_mp3(const char *info){ //end of file Serial.print("eof_mp3 ");Serial.println(info); } void audio_showstation(const char *info){ //PRINT STATION INFO Serial.print("station ");Serial.println(info); /*Serial2.print("Station: ");*/Serial2.println(info); } void audio_showstreamtitle(const char *info){ //PRINT SONG TITLE INFO Serial.print("streamtitle ");Serial.println(info); /*Serial2.print("Song Title: ");*/Serial2.println(info); } void audio_bitrate(const char *info){ Serial.print("bitrate ");Serial.println(info); } void audio_commercial(const char *info){ //duration in sec Serial.print("commercial ");Serial.println(info); } void audio_icyurl(const char *info){ //homepage Serial.print("icyurl ");Serial.println(info); } void audio_lasthost(const char *info){ //stream URL played Serial.print("lasthost ");Serial.println(info); } void audio_eof_speech(const char *info){ Serial.print("eof_speech ");Serial.println(info); }
- Thoughts/ Point in the right direction?
-
Combine 2 analog signals = mixing?
Are you sure? This project seems to think otherwise, although if you want analog it might be a fun experiment to make it use the ESP32's DAC rather than the I2S peripheral.
-
Is it possible to stream audio from a web server to an ESP32?
I think the best way is to use a I2S amplifier, and a library like this: https://github.com/schreibfaul1/ESP32-audioI2S
-
HELP! Cannot get I2S output on Adafruit esp32 feather V2!
I use that same DAC for this project : https://github.com/marchingband/campusradioradio/blob/main/campusradioradio.ino which uses this Arduino library https://github.com/schreibfaul1/ESP32-audioI2S
-
How to - Play WAV files from SD card with I2S
I tried these libraries: https://github.com/pschatzmann/arduino-audio-tools https://github.com/schreibfaul1/ESP32-audioI2S
-
PSRAM alternatives?
I need to add more memory to my Lolin32 Webradio to avoid the constant dropouts that some stations have given. I use the ESP32-audioI2S library. Here in Brazil, access to components is extremely difficult, and we often resort to expensive imports via Aliexpress or eBay. The modules or memory chips that we have on the market are usually of the I2C flash type, like this one or this one. On Aliexpress, the only PSRAM I found was the 23LC1024 chip (128kB - $5.04). But I see chips 23K256 (32kB SPI serial SRAM - $1.38), 24C1024 (128kB I2C EEPROM - $2.30) and 25LC1024 (128kB SPI EEPROM - $1.84) available. Can I use these cheaper options?
freac
-
Did I make a mistake for purchasing music from iTunes Store?
Seconding basically everything that's been said here, but should you ever find yourself in need of a good file converter, I like and use fre:ac (www.freac.org), an open source Swiss army knife for audio formats.
-
Hi-SP 256kbps ATRAC3+ or MD-SP 292kbps ATRAC
That's a lot of steps! I believe there's FLAC rippers for Tidal, that may make it easier to use WebMD or SonicStage. I use https://www.freac.org/ to convert from FLAC (which I rip my CDs in) to WMA Lossless (which SonicStage can use) - Web Minidisc can use FLAC directly, as well.
-
A way to get CD metadata and artwork
You might want to use a tool like https://www.freac.org for the conversion.
-
Could use some help dumping CDs.
I use fre:ac personally - https://www.freac.org
-
Fan's! Of SUBLIME! What!? Would? Be The Best Way To Go About Doing This!?...
A lot of bootlegs are already ripped and available. wondering if the ones you have are the ones that are already available. you can download https://www.freac.org/ and rip em.
-
FLAC to MP3 conversion
https://www.freac.org/ my go-to for a loooong time
-
Hi-SP - any regular users? Only recently gpt this HiMD and today I'm making my first recording, hi-sp via optical from a cd player.
What I was doing when I want 352k AT3+ files was to use https://www.freac.org/ to convert FLACs to WMA Lossless files which SonicStage 4.3 can read, then hook up the HiMD machines, pick the songs/album/whatever, and transfer them at 352k. It does the transcode on the fly but you can pick "fast" vs. "quality" modes, either should really be good but I did "quality" because the 10-year-old computer I'm doing it on should be 2-5x faster than an average computer in 2007 when SS4.3 was released so it's not that big of a deal.
-
Newbie Hi-MD Question (Roast Anticipated)
If you need to convert FLAC/AAC/ALAC/whatever to a format SonicStage supports (LPCM WAV or lossless WMA) - you can use a tool like the Free Audio Converter (FRE:AC).
-
Transfers are not allowed. [SonicStage]
For lossless or high-resolution audio, I use a tool called FREAC to convert FLAC/ALAC and anything else SonicStage itself can't use to WMA Lossless, which gets you both proper metadata support and CD quality lossless files.
-
MP3 converters. What do you guys use
fre:ac does pretty much everything you could want: https://www.freac.org/
What are some alternatives?
ESP8266Audio - Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
AaxAudioConverter - Convert Audible aax files to mp3 and m4a/m4b
esp-adf - Espressif Audio Development Framework
whipper - Python CD-DA ripper preferring accuracy over speed
arduino-audio-tools - Arduino Audio Tools (a powerful Audio library not only for Arduino)
Auto-M4B-Tool - Script to automate using m4b-tool to convert recently added mp3 audiobook folders to a single chapterized m4b.
yummyDSP - An Arduino audio DSP library for the Espressif ESP32 and probably other 32 bit machines
audacity - Audio Editor
ESP32_WebRadio - An Internet web radio based to ESP32
AutoEq - Automatic headphone equalization from frequency responses
HubAlyzer - A spectrum analyzer display for HUB75 RGB LED panels and I2S microphones
FlexASIO - A flexible universal ASIO driver that uses the PortAudio sound I/O library. Supports WASAPI (shared and exclusive), KS, DirectSound and MME.