How can ESP32 connect to a Bluetooth Speaker and play, pause, resume a sound or MP3 file?
Opened this issue · 2 comments
You have done amazing project using ESP32 but I need just connect ESP32 to connect with a Bluetooth Speaker and then play,pause,resume a sound or these functions on a MP3, Wav,etc file.
Your help greatly appreciated.
For BT you'll want to use the A2DP Source: https://github.com/espressif/esp-idf/tree/be81d2c16d7f4caeea9ceb29fece01510664caf3/examples/bluetooth/a2dp_source
It's was a bit rough last time I used it and seems to be under active development. It'll only play a single bitrate / frequency for example, and that's not even specified. I think it was 44.1khz, 16bit stereo. The easiest solution is to pre-convert the files and just stream them through. You might need to use external storage if there isn't enough free flash. I also couldn't find a single event triggered via the media keys on the BT speaker which was unfortunate.
I've been trying to comprehend the a2dp source and I'm still a bit confused with it.
Has anyone else had any luck getting it to work?