The demo plays a MP3 stored on the flash using audio pipeline API
This example is will run on boards marked with green checkbox. Please remember to select the board in menuconfig as discussed is section Usage below.
Board Name | Getting Started | Chip | Compatible |
---|---|---|---|
ESP32-LyraT | |||
ESP32-LyraTD-MSC | |||
ESP32-LyraT-Mini | |||
ESP32-Korvo-DU1906 | |||
ESP32-S2-Kaluga-1 Kit |
Prepare the audio board:
- Connect speakers or headphones to the board.
Configure the example:
- Select compatible audio board in
menuconfig
>Audio HAL
.
Make Spiffs file
-
Get the mkspiffs from github/spiffs
- git clone https://github.com/igrr/mkspiffs.git
-
Complie the mkspiffs
cd mkspiffs make clean make dist CPPFLAGS="-DSPIFFS_OBJ_META_LEN=4"
-
Copy music files into tools folder(There is only one adf_music.mp3 file in the default tools file).
-
Running command
./mkspiffs -c ./tools -b 4096 -p 256 -s 0x100000 ./tools/adf_music.bin
. Then, all of the music files are compressed intoadf_music.bin
file.
Download
- Create partition table as follow
nvs, data, nvs, , 0x6000, phy_init, data, phy, , 0x1000, factory, app, factory, , 1M, storage, data, spiffs, 0x110000,1M,
- Download the spiffs bin. Now the
./tools/adf_music.bin
includeadf_music.mp3
only (All MP3 files will eventually generate a bin file).python $ADF_PATH/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 write_flash -z 0x110000 ./tools/adf_music.bin