How to play Wav files in esp8266

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
HanhsomeTom
Posts: 1
Joined: Sat Apr 04, 2020 2:46 am

How to play Wav files in esp8266

Post by HanhsomeTom » Sat Apr 04, 2020 2:53 am

need Help,please~~

jomas
Posts: 50
Joined: Mon Dec 25, 2017 1:48 pm
Location: Netherlands

Re: How to play Wav files in esp8266

Post by jomas » Sat Apr 04, 2020 3:28 pm


User avatar
jimmo
Posts: 2244
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: How to play Wav files in esp8266

Post by jimmo » Sun Apr 05, 2020 5:59 am

Playing a wav file is going to be a bit tricky on the ESP8266 because it doesn't have a hardware DAC.

You have a few options -- external I2S DAC, etc. I've heard of people doing software sigma-delta on ESP8266 (but I imagine it doesn't sound great). But none of this has easy support from MicroPython.

I guess what I'm trying to say is, there's no easy option, but depending on how much effort you're prepared to put in you might be able to make something work -- need more information about what you were expecting. You're probably better off using a more capable microcontroller.

Misterguru
Posts: 1
Joined: Fri Feb 19, 2021 8:05 pm

Re: How to play Wav files in esp8266

Post by Misterguru » Fri Feb 19, 2021 8:09 pm

Over 3 years later... I have the same question... so, using a DAC, is there an I2S (IIS) Library for 8266? I am using a Wemos D1 mini clone

jamesboblak
Posts: 1
Joined: Mon Mar 01, 2021 7:19 pm

Re: How to play Wav files in esp8266

Post by jamesboblak » Mon Mar 01, 2021 7:29 pm

Did you find any? I'd like to get an I2S microphone into either my 8266 or ESP32. They both have I2S capability, but I can't seem to find a way to get this little SPH0645 mic to connect in MicroPython. For that matter, I've also got a MAX98357 I2S amplifier, but can't find resources for it either. Any help is much appreciated :)

User avatar
Mike Teachman
Posts: 100
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: How to play Wav files in esp8266

Post by Mike Teachman » Wed Mar 03, 2021 6:02 am

If you are comfortable making your own custom build one option is integrating this PR for the ESP32:
https://github.com/micropython/micropython/pull/4471

Documentation for the PR is here:
https://github.com/miketeachman/micropy ... s-examples

Included in the documentation are pre-built uPy ESP32 binaries that include the I2S functionality.
https://github.com/miketeachman/micropy ... r/firmware

That might be a place to start? Note that this I2S PR was updated a few days ago to use the ESP32 cmake build.

oyster
Posts: 8
Joined: Tue Feb 16, 2021 1:21 pm

Re: How to play Wav files in esp8266

Post by oyster » Fri Mar 05, 2021 2:00 am

is this video relevant?

User avatar
Mike Teachman
Posts: 100
Joined: Mon Jun 13, 2016 3:19 pm
Location: Victoria, BC, Canada

Re: How to play Wav files in esp8266

Post by Mike Teachman » Fri Mar 05, 2021 3:00 am

oyster wrote:
Fri Mar 05, 2021 2:00 am
is this video relevant?
.
Not Really. The video describes implementation of an I2S WAV player by writing C code using the Arduino editor. The poster is interested to use MicroPython.

Post Reply