Inserting Google's text-to-speech fails to connect

1,329 views
Skip to first unread message

rafael...@gmail.com

unread,
Aug 6, 2020, 6:41:40 AM8/6/20
to mnemosyne-proj-users

Greetings everyone, I'm having a problem trying to use the Google's text-to-speech feature.



The error message:


Failed to connect. Probable cause: Host 'https://translate.google.en-US/' is not reachable


Traceback (innermost last):

File "/usr/lib/python3/dist-packages/mnemosyne/pyqt_ui/pronouncer_dlg.py", line 30, in run

filename = self.pronouncer.download_tmp_audio_file(\

File "/usr/lib/python3/dist-packages/mnemosyne/libmnemosyne/pronouncers/google_pronouncer.py", line 36, in download_tmp_audio_file

tts.save(filename)

File "/home/rafa/.local/lib/python3.8/site-packages/gtts/tts.py", line 295, in save

self.write_to_fp(f)

File "/home/rafa/.local/lib/python3.8/site-packages/gtts/tts.py", line 272, in write_to_fp

raise gTTSError(tts=self)

gtts.tts.gTTSError: Failed to connect. Probable cause: Host 'https://translate.google.en-US/' is not reachable


What I tried:


I installed gTTS and googletrans using pip3, but it did not solve the problem.


My setup:


I'm currently using Ubuntu 20.04.1 LTS x86_64


Peter Bienstman

unread,
Aug 6, 2020, 6:45:31 AM8/6/20
to mnemosyne-...@googlegroups.com
Hi,

It could be that the servers are indeed not reachable, or that you have done too many requests recently. 

It could also be a bug in gtts. You might try with the current development version of gtts from github. 

Cheers, 

Peter 


--
You received this message because you are subscribed to the Google Groups "mnemosyne-proj-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mnemosyne-proj-users/9450c21d-0205-4132-bb28-c948bf910f51o%40googlegroups.com.

Peter Bienstman

unread,
Aug 9, 2020, 4:58:38 AM8/9/20
to mnemosyne-proj-users
After updating gTTS on my system, I had similar problems. Turns out the 2.x version of gTTS changed the API syntax, which is why you have problems. The latest version of Mnemosyne on github should fix this.

Cheers,

Peter
To unsubscribe from this group and stop receiving emails from it, send an email to mnemosyne-proj-users+unsub...@googlegroups.com.

Rafael Prates

unread,
Aug 15, 2020, 12:36:11 AM8/15/20
to mnemosyne-proj-users
I followed your instructions and downloaded the latest version from github. It worked.

Thank you for your help.
Reply all
Reply to author
Forward
0 new messages