I am thinking of making a wireless speaker using the ESP8266 chip. I have some questions regarding this.
Which pin of the ESP8266 chip can be used as I2S output? I have an ESP chip of this type :
enter image description hereWhich ESP chip would be the best choice for this purpose?
I know about the MAX98357A which is used to convert digital I2S data to analog. But, for stereo output I need to use 2 of those. Is there any alternative to this chip which supports stereo output by default?
I have found many tutorials which shows how to play audio from SD card of ESP8266. But, how can I stream audio over standard WiFi connection?
1 Answer 1
Which pin of the ESP8266 chip can be used as I2S output?
I uses GPIOs 2, 3, and 15. You only have GPIO2 available, and that's also one half of the UART interface. Also you usually need to generate a "master" clock (usually something like 256x the bit clock) for oversampling. So you can't with that module.
Which ESP chip would be the best choice for this purpose?
ESP32, without a shadow of a doubt.
I know about the MAX98357A which is used to convert digital I2S data to analog. But, for stereo output I need to use 2 of those. Is there any alternative to this chip which supports stereo output by default?
Yes, there are plenty. The search term you want is "CODEC". Personally I use the TLV320DAC3101.
You never use two separate mono CODECs for stereo, since I2S is a (normally) stereo protocol for connecting to a stereo CODEC. Reliably splitting a stereo I2S stream into two mono ones is not easy.
I have found many tutorials which shows how to play audio from SD card of ESP8266. But, how can I stream audio over standard WiFi connection?
By implementing a suitable protocol, and that depends entirely on what your audio is and how it is generated.
-
For number 3 I am thinking of this technique : electronics.stackexchange.com/questions/295889/…Puspam– Puspam2020年03月03日 14:51:41 +00:00Commented Mar 3, 2020 at 14:51
-
Can you please elaborate on the last answer? I simply want to stream MP3 audio.Puspam– Puspam2020年03月03日 14:52:57 +00:00Commented Mar 3, 2020 at 14:52
-
1There is no such thing as "simply" streaming MP3. Streaming involves buffering, then decoding (in a timely manner) the audio from compressed MP3 format into a PCM format. Then feeding that through other buffers to the I²S hardware. If you are streaming a live stream (radio, for example) then you have to be able to cleanly handle "xruns" (buffer under- or over-runs) where the sender isn't sending at the same speed as you're playing. So your project really comprises three parts: 1. Getting the data. 2. Decoding the data. 3. Sending the data to I²S. All three of those are difficult tasks.Majenko– Majenko2020年03月03日 15:08:47 +00:00Commented Mar 3, 2020 at 15:08
-
What did you mean by usually something like 256x the bit clock) for oversampling. So you can't with that module.?Puspam– Puspam2020年03月03日 17:04:16 +00:00Commented Mar 3, 2020 at 17:04
-
You don't have the required pins available. So you can't with that module. On top of that you have to usually generate a master clock. And there's no pin for that on that module. So you can't with that module. You just can't with that module.Majenko– Majenko2020年03月03日 17:06:43 +00:00Commented Mar 3, 2020 at 17:06