Skip to content

Latest commit

 

History

History
 
 

pipeline_spiffs_mp3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Play MP3 file from flash (spiffs system)

The demo plays a MP3 stored on the flash using audio pipeline API

Compatibility

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 alt text ESP32 alt text
ESP32-LyraTD-MSC alt text ESP32 alt text
ESP32-LyraT-Mini alt text ESP32 alt text
ESP32-Korvo-DU1906 alt text ESP32 alt text
ESP32-S2-Kaluga-1 Kit alt text ESP32-S2 alt text

Usage

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

  • 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 into adf_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 include adf_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