A2DP Source - Play online .wav file to bluetooth speaker? Confused #616
-
Hello, I would like to be able to play audio files that I generate online (text to speech) with my esp32 through my Bluetooth speaker. I'm really struggling to figure out how to get this to work. I saw that wifi and Bluetooth can't work at the same time so I believe I would need to connect to wifi > download the wav file > disconnect from wifi > convert the audio to the correct format > connect to Bluetooth speaker and play the audio > disconnect from Bluetooth speaker > repeat for new files I want to play. Has anybody done something similar that I could take a look at or a basic sketch with this functionality would be amazing as I'm struggling to combine the example sketch for playing a random tone to a Bluetooth speaker which works with the other examples in the audio library |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
A2DP as audio source is pretty tricky to use, so I would not recommend it, if you are a beginner. I suggest to validate the statement that Wifi and A2DP can't be used together. If I remember right it is mainly because there is not enough RAM, but you can try if you can circumvent this limitation by using SPIRAM. Another option would be to use a separate WIFI module or another ESP32 to do the ip communication. |
Beta Was this translation helpful? Give feedback.
A2DP as audio source is pretty tricky to use, so I would not recommend it, if you are a beginner.
I suggest to validate the statement that Wifi and A2DP can't be used together. If I remember right it is mainly because there is not enough RAM, but you can try if you can circumvent this limitation by using SPIRAM.
Another option would be to use a separate WIFI module or another ESP32 to do the ip communication.
But I would rather replace the A2DP with the output to a DAC...