0

I am thinking of making a wireless speaker using the ESP8266 chip. I have some questions regarding this.

  1. Which pin of the ESP8266 chip can be used as I²S output? I have an ESP chip of this type :
    enter image description here

  2. Which ESP chip would be the best choice for this purpose?

  3. I know about the MAX98357A which is used to convert digital I²S 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?

  4. 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

2

Which pin of the ESP8266 chip can be used as I²S 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 I²S 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 I²S is a (normally) stereo protocol for connecting to a stereo CODEC. Reliably splitting a stereo I²S 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.

7
  • For number 3 I am thinking of this technique : electronics.stackexchange.com/questions/295889/…
    – Puspam
    Commented Mar 3, 2020 at 14:51
  • Can you please elaborate on the last answer? I simply want to stream MP3 audio.
    – Puspam
    Commented Mar 3, 2020 at 14:52
  • 1
    There 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
    Commented 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
    Commented 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
    Commented Mar 3, 2020 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.