For the complete documentation index, see llms.txt. This page is also available as Markdown.

14.Play MP3

There is a demo named testMP3 in the "OpenCatEsp32/ModuleTests" file directory. The main function of this demo is to play .mp3 files stored in the SPIFFS file system. Users can choose to play different .mp3 files by entering 0~6 numbers (the .mp3 file index) in the serial monitor.

Before compiling the demo, please download, install, and configure the software environment (Arduino IDE 1.8.19, development board esp32 2.0.12, library ESP8266Audio 1.9.7, partition configuration BiBoard V0 or BiBoard V1).

After compiling, use the latest SPIFFS file upload plugin to upload the .mp3 file to the SPIFFS file system partition of BiBoard. For details, please refer to the chapter File System SPIFFS.

Note:

  • The SPIFFS file upload plugin in Arduino IDE 1.8.* is written in Java. And Arduino IDE 2.0 is written in a different language (TypeScript + Golang), so the previous upload plugin cannot be used in Arduino IDE 2.0. There is currently no support for the Arduino IDE 2.0 SPIFFS file upload plugin.

So it is recommended that you temporarily install and use the Arduino IDE 1.8.* IDE to upload sketch and .mp3 file.

Of course, you can also use VS Code + PlatformIO to upload the sketch and .mp3 files. For details, please refer to the following documents:

Before uploading the sketch and .mp3 files, please move the "data" folder to the project root directory, store the code files in the "src" directory, and configure the partition option "board_build.partitions" in the platformio.ini in the project root directory, as shown in the following figure:

For the BiBoard V1

On the BiBoard V1 mainboard, the two pins associated with the DAC function are already utilized by the voice module; therefore, to enable MP3 playback, a hardware modification is required (soldering a jumper wire to connect ESP32's pin 25 to the input pin of the power amplifier chip), as shown in the figure below:

After performing the hardware modification, if you upload the original OpencatEsp32.ino's firmware: when using the voice command to control the robot, the voice module can't provide a voice response, but the robot can perform the action response. If you restore the original hardware configuration (remove the jumper wire from the mainboard pins). The voice module can work normally. We have fully verified the functionality, so please feel free to modify the hardware settings; however, exercise caution when soldering jumper wires to ensure they connect to the correct pins.

Last updated