Google text-to-speech error

74 views
Skip to first unread message

W NW

unread,
Feb 1, 2021, 4:04:13 PM2/1/21
to mnemosyne-proj-users
Dear,

I am using 2.7.3 Mnemosyne version under Windows 7.

Since couple of days I have the below error message when trying to add the google text-to-speech: "An unexpected error has occured. Please forward the following to the developers: 
Traceback (innemorst last): File "mnemosyne\pyqt_ui\qtextedit2.py", line 107, in keyPressEvent (...)" etc. - I paste the screen.

error.jpg

Effectively no Google-pronounciation is added to cards; before it used to work perfectly under 2.7.3.

Could you please let me know any suggestions?

regards
blickwn


Peter Bienstman

unread,
Feb 2, 2021, 5:26:24 AM2/2/21
to mnemosyne-...@googlegroups.com
Hi,

I'm afraid it works fine on my Windows 10 machine. It might be a temporary glitch with the Google servers. So far I have not received any other reports from this. Note that Windows 7 is no longer supported, it reached end-of-life in January 2020...

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/b21c00fb-7f2c-42a8-be51-215f740e8b96n%40googlegroups.com.

W NW

unread,
Feb 2, 2021, 3:08:48 PM2/2/21
to mnemosyne-proj-users
Hi, thanks for taking time. 

Under Windows 7 I have been using Mnemosyne 2.7.3  since it was published with no issues at all. So it would be quite strange that Win7 is the main culprit , though of course one cannot exclude it. 

Today I noticed two similar errors, please see below. I also noticed that the issue occurs also when trying to export cards - after clicking the last "OK" before exporting; and the cards are not exported. 

Today I tried uninstalling and installing the Mnemosyne again - with no effect. Would you have any other suggestions please? The text-to-speech is a very important function to me, used on a daily basis...

error_02.jpg

error_03.jpg

regards
blickwn

Oisín Mac Fhearaí

unread,
Feb 2, 2021, 5:05:10 PM2/2/21
to mnemosyne-...@googlegroups.com
The "lang" parameter in the call to gTTS seems to have caused problems for people recently.

The problem in the cases I've seen were caused by a language string of "en-US" and "en-CA". In both cases, switching to just "en" fixed the problem.
Looking at the file google_pronouncer.py in the Mnemosyne source suggests that the language parameter is derived from the card type property "sublanguage_id", or the property ""language_id" if that's not available. Can you check if they're set to something like "en-US" and replace them with "en" to see if that helps?

Oisín

Peter Bienstman

unread,
Feb 3, 2021, 5:47:53 AM2/3/21
to mnemosyne-...@googlegroups.com
Thanks for tracking this down! (My own cards never used a sublang, which is why I could not reproduce it.)

I noticed that the people behind gtts, the google text-to-speech library, are preparing a new release to fix these and other issues, and when it's released, I can prepare a new Windows installer.

Meanwhile, Oisin's workaround of not selecting a sublanguage should help.

Cheers,

Peter

W NW

unread,
Feb 3, 2021, 1:04:47 PM2/3/21
to mnemosyne-proj-users
Thank you Oisin and Peter. 

I am afraid that I will have to hope for the Windows installer that Peter mentioned as I am not "technical" enough to change the Mnemosyne source code... I also do not know how not-to select the sublanguage.

Or perhaps I am missing something? And if the workaound could be applied from the level of Mnemosyne itself or by editing some Mnamosyne files -  could you please give me more details how to do this?

regards
blickwn

Peter Bienstman

unread,
Feb 3, 2021, 2:17:36 PM2/3/21
to mnemosyne-...@googlegroups.com
In the text-to-speech dialog there's an option to choose the sublanguage in case more than one variant is available. Just make sure it's set to 'default'.

Cheers,

Peter

W NW

unread,
Feb 3, 2021, 4:18:55 PM2/3/21
to mnemosyne-proj-users
OK,  thanks - I see four variants for English language: UK, US, India, Australian, please find screen below; but whichever I choose I have the same error, and it appears the moment I am choosing one of the variants (ie. even without clicking Preview or Insert). What's more - the text-to-speech dialogue appears only when the Back of the card   (= my foreign language) is empty; and when there is a word written in the Back of the card I even cannot get to the text-to-speech dialogue because the error occurs immediately when I choose Ctrl+P or Insert GTTS from the menu. 

Am I doing something wrong here?

GTTS Dialogue.jpg


Just for the full picture I attach also the screen of my Card-types configuration; 
the same error concerns both of my card types: English and French (with French having  two language variants: France and Canada).

CardTypes.jpg

regards
blickwn 
 

Peter Bienstman

unread,
Feb 3, 2021, 4:32:21 PM2/3/21
to mnemosyne-...@googlegroups.com
OK, let's see if gtts quickly releases a new version, otherwise I'll hack together a temporary workaround.

Peter 

Peter Bienstman

unread,
Feb 4, 2021, 11:12:00 AM2/4/21
to mnemosyne-proj-users

W NW

unread,
Feb 4, 2021, 12:47:22 PM2/4/21
to mnemosyne-proj-users
Dear Peter, 

this version works perfectly, gtts and also exporting. I am really impressed by the support here, thank you so much!

regards
blickwn

Reply all
Reply to author
Forward
0 new messages