Low audio output on BT speaker receiving A2DP transmission from ESP32 #1744
-
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 25 replies
-
Here is some more info about TTS... |
Beta Was this translation helpful? Give feedback.
-
I think Talkie is a cool functionality: so I was putting together some new project which uses Talkie to generate PCM data. I suggest that you have a look at this. Don't worry about PSRAM: if PSRAM has been activated, then all arrays that would be allocated in RAM will go to PSRAM instead. This is actually good since the RAM is quite limited, compared to the PSRAM. Not sure what's causing the issue with the lost start of the audio: I will need to look into this.... |
Beta Was this translation helpful? Give feedback.
-
First I fixed the problem with the dot/point in the simple-tts and made sure that the library is updated to the latest convention of the Audio Tools. Then I tested with the example sketch using simple-tts with a2dp and did not notice any issues. Try to update all libraries and mybe test with another bluetooth speaker. Is the example sketch for you breaking up as well ? I also added an talkie to a2dp example that was not working because talkie is just writing too many individual samples instead of a buffer of samples: I added a BufferedStream into the chain and then it was working perfectly as well. |
Beta Was this translation helpful? Give feedback.
-
Nop, libhelix is a separate project that needs to be installed like any other codec. The speach is stored as mp3 in PROGMEM, so the tts needs a codec to decode it to PCM. Example with Helix: #include "AudioTools.h"
#include "AudioTools/AudioCodecs/CodecMP3Helix.h"
#include "SimpleTTS.h"
I2SStream out;
VolumeStream volume(out);
MP3DecoderHelix mp3;
AudioDictionary dictionary(ExampleAudioDictionaryValues);
NumberUnitToText utt;
TextToSpeech tts(utt, volume, mp3, dictionary); You can look up the corresponding values in the table of this wiki and just replace them: Example with Libmad: #include "AudioTools.h"
#include "AudioTools/AudioCodecs/CodecMP3MAD.h "
#include "SimpleTTS.h"
I2SStream out;
VolumeStream volume(out);
MP3DecoderMAD mp3;
AudioDictionary dictionary(ExampleAudioDictionaryValues);
NumberUnitToText utt;
TextToSpeech tts(utt, volume, mp3, dictionary); Of cause you need to have this decoder library installed as well.. |
Beta Was this translation helpful? Give feedback.
-
The logic was somehow generating a null pointer execption. If the audio is breaking up, you can play around with the following A2DP parameters auto cfg = a2dp.defaultConfig(TX_MODE);
cfg.name = name;
//cfg.silence_on_nodata = true; // allow delays with silence
cfg.delay_ms = 0;
cfg.buffer_size = 1024 * 7;
a2dp.begin(cfg); The above parameters were working for me... |
Beta Was this translation helpful? Give feedback.
-
How did you install this library in the past ? You don't do anything with the commits: this just shows you the latest changes that you get when you download the main branch. |
Beta Was this translation helpful? Give feedback.
-
No, I have never seen this and if you check my projects, I do not use the IRAM_ATTR qualifier anywhere. You might try if some prior ESP32 core versions are working for you... |
Beta Was this translation helpful? Give feedback.
-
Thanks for a great suggestion - I rolled the esp32 board core version back to 2.0.13 (from 2.0.14), and... Voila! - now the code compiles and runs the way I expect it should! I have spent dozens and dozens of hours trying to get to the bottom of this problem, and it turns out to be a board core definition issue. |
Beta Was this translation helpful? Give feedback.
-
Oh my good: 2.0.14 ? The actual released version is 3.0.7 and 3.1 is in R3 |
Beta Was this translation helpful? Give feedback.
Here is some more info about TTS...