Open lioujj opened 3 years ago
Same issue here. ESP32 completely freezes after playing google tts. It had worked for half a year perfectly fine but the same problem occurs now on two different devices here that use esp8266audio to play google tts.
Error (several of these): STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 33265'
Then it shows "Running for xxx ms" two times (the second one appearing after more than a second) and then the ESP32 completely freezes. No further output on serial, no reaction anymore...
Would be cool to get this error fixed as i prefer google tts instead of esp8266sam becuase it talks more clearly and supports more than only english language ;-)
Thanks
Same problem here : I play one google tts mp3 then it hang immediately at the end of the sound. I tried :
Always with the same result : it play correctly but no more response from the ESP and no stack trace... May be a debugger with ESP32 could be useful for better investigation ?
Edit : some additional test & information :
So there is something which hang in the library (may be in "bool AudioGeneratorMP3::loop()" ? ) when playing specific url from google TTS...
Hi, easy way to reproduce the bug : Take "StreamMP3FromHTTP" example, and replace :
const char *URL="http://kvbstreams.dyndns.org:8000/wkvi-am";
with
const char *URL="http://translate.google.com/translate_tts?ie=UTF-8&q=bonjour&tl=fr&client=tw-ob&ttsspeed=1";
This is a record of the sound that I obtain.
Output of the StatusCallback :
...Connecting to WiFi Connected +0 0x3ffb1ed8 Running for 4334 ms... STATUS(buffer) '2' = 'Refilling buffer' STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 2048' STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 2049' STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 2050' STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 2051' STATUS(mp3) '257' = 'Decoding error 'lost synchronization' at byte offset 2052'
... And after a long time (about 3 minutes), the hang is released (if we stop the output before the end of the file there is no hang) :
STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' Running for 244596 ms... STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' STATUS(mp3) '1' = 'Decoding error 'input buffer too small (or EOF)' at byte offset' MP3:ERROR_BUFLEN 0 STATUS(buffer) '2' = 'Refilling buffer' STATUS(buffer) '3' = 'Buffer underflow' MP3 done MP3 done MP3 done
The codec used by Google TTS seems classic :
@FedericoBusero You have resolved a similar issue with RTTTL recently (thanks for that !) , do you have an idea for this one too ? Having good and multilingual TTS on ESP is a killer feature 😉
Managing Google TTS seems more complex than what I was thinking... I found this great I2S library which support Google TTS: ESP32-audioI2S
As you can see here the author has made a complex function to use Google TTS. This could be a good source of inspiration to make a new AudioFileSourceGoogleTTS.h 😅
Interesting facts : I also tested to play Google TTS on this library without using this specific function, just with the URL of Google Translate and the result was similar to ESP8266Audio : at the end of the play there is a buffer problem. It doesn't hang the ESP on this library but it means that Google TTS send the mp3 file in a particular way which require more work than a classic mp3 stream.
Hi When I use AudioFileSourceICYStream to play google TTS voice 2 or 3 times, it will crash! I try to increase the buffer size, but it still not works.
TTS code here: i2sFile = new AudioFileSourceHTTPStream("http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&tl=en&q="+YourTextHere);
I use a DAC MAX98357A. Thanks!