How can I load specific parts of audio data from an SD card every 10 seconds to not fill the sketch storage? #343
-
I wanted to play longer songs with the ESP32 through Bluetooth, but the memory limit on the ESP32 is under 5 megabytes and putting entire uncompressed songs in the sketch storage is not gonna work, and most of the time I have to only put 20 seconds of the song in the ESP32 for the memory to be enough. I thought using a SD card reader would allow me to increase the amount of data I can play, but I can't load all of it at the same time and I will need to load some of it, and then some time later load the other parts. How can I do this with the library? Is there any way to set a data offset? Is there a better way to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Just use my AudioTools library: here is the related example: https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-basic-api/base-player-a2dp/base-player-a2dp.ino You could also play some mp3 form progmem which uses less space |
Beta Was this translation helpful? Give feedback.
-
Difficult to say what you are doing wrong: Usually you would just need to set up SPI properly and on the File API provide the correct CS pin. Maybe you should try to lean how to read a file and then just use that API. After all I am supporting 8 different file libraries and all have been tested and are working propery. Details can be found in the Wiki documentation... ps. you don't need to use the player. The simplest is to just copy the content of a RAW file to feed the Bluetooth callback API. |
Beta Was this translation helpful? Give feedback.
Just use my AudioTools library: here is the related example: https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-basic-api/base-player-a2dp/base-player-a2dp.ino
You could also play some mp3 form progmem which uses less space