【Feedback】I2S sound output and MP3 decoding in an ESP8266

ESP_Sprite
Posts: 26
Joined: Fri Oct 24, 2014 7:58 pm

【Feedback】I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Sprite » Fri Jun 05, 2015 6:49 pm

As you all may know, the specsheet for the ESP8266 describes the chip as having an I2S port, which is a port to which you can connect an I2S DAC to get sound in and out of the chip. Unfortunately, up until now no documentation or examples about this port were available. We're working on these documents and examples right now, and I have taken the preliminary documentation and with the help of some colleagues here at Espressif have whipped up a little demonstration which uses HTTP to stream an MP3 stream (eg. webradio) to an I2S DAC. It basically is a standalone webradio streamer, everything (WiFi, HTTP streaming, MP3 decoding) happens inside the ESP8266. The only components you need to get good audio quality are an I2S audio DAC for audio output and a 23LC1024 SPI RAM chip for buffering of the MP3 stream. If bad quality audio and stuttering is acceptable, there even is a mode where you can stream audio without these two components: using only an ESP module (in theory, an ESP01 would work), a power supply and an amplifier/speaker you can get reasonable quality sound.

The code is at the official Espressif Github: https://github.com/espressif/esp8266_mp3_decoder
Be sure to read the README.md in the archive, configuration and use of the decoder can be a bit tricky.

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby rudi » Sun Jun 07, 2015 12:34 pm

ggggggrrrrrrreeeeeáaaaaaaaaattttt!!!!

sprite!
ESP8266 goes MP3 (320 Kb)
DONE!
;-)
you did it again. ( 2:1 )
;-) perfect - no problems - test without the 2 ICS - hear with in ear phone'S and
it runs perfect!

i hear just in time in 320 kb/s streaming mp3 "summerbeat 2013" from simpy test IIS7 server.

my extended favorit tip:

run mediaserver (media encoder...) - stream audio ( voice, or other src ) over media server and you will have the babyphone ( wifi speaker ) with ESP8266 mp3

;-)

"10K thanks button"
txs! great work - sprite clear code - fine struct -
and espressif - fine documented - nice!!!
now its time for next surprise ...

best wishes
rudi ;-)

btw ;-)

welcome to espressif team!

;-)

-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

mikewen
Posts: 1
Joined: Mon Jun 15, 2015 6:19 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby mikewen » Mon Jun 15, 2015 6:22 am

This is awesome!!! Thanks!

Do you know how to use I2S input device such as MEMS microphone?

Roie
Posts: 2
Joined: Wed Jun 10, 2015 2:52 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby Roie » Tue Jun 16, 2015 9:47 pm

What do you mean?

if my understanding is current, the MEMS Microphone get a clock and push data over I2S

btw,
i also try to loop every 20ms I2SRXFIFO, but still not working
data = (uint8)(READ_PERI_REG(I2SRXFIFO)&0xff);

rojer
Posts: 12
Joined: Mon Jun 15, 2015 5:51 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby rojer » Sat Jan 02, 2016 1:03 am

thanks for this, a very useful example!

i have question regarding bit/word clock generation: i am considering ESP8266 for an application which does both output (to a speaker) and input (from a microphone). i see that bit and word clock lines on ESP are separate, but the DAC/ADC i am considering uses the same BCK/WS for input and output. so the question is: (1) does ESP generate I2S clock only when there is data to output? and (2) can it use its own clock for I2S input, preferably without physically connecting I2SI_{BCK,WS} to their I2SO counterparts (to free up pins for other functions)?

micke_s
Posts: 1
Joined: Wed Jun 29, 2016 2:40 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby micke_s » Wed Jun 29, 2016 2:43 am

Hi Sprite_tm. Great work.

Is it possible to upgrade to newest SDK?
The new SDK use less ram so it will be nice to use it i think...

ESP_Greg

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Greg » Thu Jun 30, 2016 11:54 am

You can try with the latest SDK. Some guy already make it work.

ESP_Rubin
Posts: 222
Joined: Wed Jun 29, 2016 11:59 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Rubin » Thu Jul 28, 2016 7:59 pm

hello,
please refer to the README as link:https://github.com/espressif/ESP8266_MP3_DECODER/blob/master/README.md

Romeo
Posts: 2
Joined: Fri Mar 24, 2017 10:32 pm

Re: 【Feedback】I2S sound output and MP3 decoding in an ESP8266

Postby Romeo » Fri Mar 24, 2017 10:39 pm

Hi,
Sorry for wasting your time, but how can I put this on my board. I have an esp01 and very hard time to figure what to do to compile it and flash it. What tools should I use? I'm using win 7.
Thanks,
Romeo

pratik

Re: 【Feedback】I2S sound output and MP3 decoding in an ESP8266

Postby pratik » Sun Mar 26, 2017 1:32 pm

http://www.espressif.com/products/hardware/esp8266ex/

Please read the Getting Started Guide here to get started with ESP8266 development. There is a flash download tool available there as well, and you can get info on how to use it in the Getting Started Guide.
Do let me know if you need any specific help. We recommend ESP-12 based boards to get started with ESP8266 development (such as NodeMCU or our own ESP-Launcher).

Who is online

Users browsing this forum: No registered users and 0 guests