MicroPython I2S Audio with the ESP32
atomic14
Does Micropython support I2S Audio on the ESP32? Almost - let's build a custom version that includes support and try it out.
Thanks to PCBWay for sponsoring this video, PCBWay offer PCB Production, CNC and 3D Printing, PCB Assembly and much much more. You can find their details here: https://www.pcbway.com/
I2S is not yet officially supported, but there is a Pull Request on GitHub that adds it in.
We can build a custom version of Micropython pretty easily. We just need the ESP-IDF from here: https://github.com/espressif/esp-idf.
And then we can get a copy of Micropython from here: https://github.com/micropython/micropython
and merge in the pull request with I2S support: https://github.com/micropython/micropython/pull/7183
The full commands to set up the IDF are:
git clone -b v4.2 --recursive https://github.com/espressif/esp-idf.git cd esp-idf ./install.sh . export.sh
And then to build our custom version of Micropython:
git clone git@github.com:micropython/micropython.git git fetch origin pull/7183/head:i2s_support git merge i2s_support make -C mpy-cross cd ports/esp32 make submodules make BOARD=UM_TINYPICO
You can find a bunch of sample code here for the I2S pull request: https://github.com/miketeachman/micropython-i2s-examples
And I've pushed up my sample code here: https://github.com/atomic14/micropython-i2s-esp32-test
--- Want to help support the channel?
I'm accepting coffee on https://ko-fi.com/atomic14 ... https://www.youtube.com/watch?v=UXt27kOokh0
47527397 Bytes