-
Notifications
You must be signed in to change notification settings - Fork 50
Outdated gTTS and poor gTTS error handling #169
Comments
I got this error, then I reread directions. Try copying the gtts folder to lib (opposed to what I did which was copy gtts to its original location). The mp3 it made is still 0 bytes 🙄 . I'm open to ideas. |
Re: I fixed my issue. The mp3 was created earlier when gtts didn't work, creating a 0B file. So when I tried making a card with the SAME characters, it checked for the file's existence and stopped at that. So, deleting the old 0B file made gtts fetch a new one which worked! Good luck. |
Wait, what do you mean? Isn't the gtts folder's original location in the lib folder??? I'm so confused. |
Sorry for lack of info. I'm on my 2015 Mac Air, the original directories are lib\gTTS\gtts. When you "replace" gtts folder, the final structure should be lib\gtts. Hopefully this is clear! |
Like I said, I'm on Mac OS 10.15.7: |
I'm also confused about what exactly to do with which files. I downloaded this folder and nested it under the original gtts folder, but am guessing this is incorrect as the problem still is not fixed. 1. did I download the correct new gtts? 2. Do I delete the old gtts and gtts_token folders or not? 3. Where should I drop the new gtts folder? (I'm on a 2014 Macbook Air, if that's relevant.) Thanks! |
@psii THANK YOU! It's totally working now. |
This is in pull request #171 , awaiting approval. |
Thank you @psii for your awesome fix and @benjewmin for pointing out the cleanup when changing to the new gtts after previous failed trials. Made the system finally work for me. |
Workaround worked for me like a charm. Thank you |
Hi,
|
This error is back now for me? I had already done this fix and it was working like a charm, but as of this evening I can make a single card, then it crashes. Restarting Anki fixes the problem, I can make a single card and then it crashes again when I try to make a second card. |
Actually for me it crashes every time. Did you check one thing : creating really a new word every time, i.e. a word that FOR SURE Anki didn't create a mp3 for? I noticed that when the crash happens for a new card/word, it still does create a mp3 but that one is always empty (0kb). So when you try to create it again, it will seem as it works (i.e., it doesn't crash), but there's actually no sound at all -> the card will refer to that previous empty file. |
Well wouldn't you know it, you are absolutely right. I just wasted a bunch of time restarting anki like a fool to add cards with an empty audio file. Nice. I guess I'll just stay posted on if anyone else figures out a workaround? I'm not a programmer so I'm afraid I won't be much help. |
I fixed it with this commit. For some reason, Google removed the I'm currently not sure how to make this easy for non-technical people. But I try. Preliminary step: Make sure that you have applied the gTTS fix as explained here and here. Then, in your Anki-Plugin folder (
The changes are always the same: Via the search&replace function of your text editor, change all occurences of |
If the commit etc doesn’t work, when programs crash like this my first
thought is permissions or missing folders. Let us know how it goes!
On Fri, Jan 29, 2021 at 8:59 AM psii ***@***.***> wrote:
I fixed it with this commit
<psii@dfebede>.
For some reason, Google removed the zh-cn, zh-CN and zh-tw langauge codes
but after giving it a try, zh works. So I added it to the gTTS code as a
valid language and changed the Anki-Plugin code accordingly.
I'm currently not sure, how to make this easy for non-technical people.
But I try.
Preliminary step: Make sure that you have applied the gTTS fix as
explained here
<#161 (comment)>
and here
<#169 (comment)>
.
Then, in your Anki-Plugin folder (.../addons21/1128979221/), the
following files need to be edited:
- config.json
- config_saved.json
- meta.json
- gui.py
- lib/gtts/lang.py
- tts.py
The changes are always the same: Via the search&replace function of your
text editor, change all occurences of zh-cn to zh. Optionally, remove all
lines containing zh-tw. You can look at this commit
<psii@dfebede>
to get an idea.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#169 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACIDRTDX3AYHP56S5LZTOKTS4K5LXANCNFSM4ULHA5MQ>
.
--
Benjamin Avery Ehrlich, BSME
Electromechanical Engineer
M: 267-721-9146
LinkedIn Github Portfolio (Coming Soon!)
…___________________________
E-Mail: [email protected]
Philadelphia, PA 19104
Drexel University, 2018
|
@psii thanks a lot for the help on this. I tried changing the files as you described, but I kept getting an error message. Ultimately I uninstalled the add-on and downloaded the commit you had uploaded, and pasted the file "chinese" containing all the json files and whatnot into my addons folder. Now it seems to be working without any issue. Thanks a lot for the help, seriously. |
@psii amazing thank you so much, the steps you described helped me fix it completely it seems, didn't need to re-install. |
@liutianruikon In your particular case it looks like you reached your daily Google GTTS request limit |
Request limit aside, a new version of the add-on will be uploaded today with an up-to-date gTTS. I'll leave this issue open while I figure out if we can show a better error message when the request limit is hit. |
2.2.1
that fixes the google translation. Copying the new gTTS code over the one shipped in this Anki extension solved it for me. Here are the steps:
The gTTS project just released a new version
2.2.1
that fixes the google translation. Copying the new gTTS code over the one shipped in this Anki extension solved it for me. Here are the steps:/home/psii/.local/share/Anki2/addons21/1128979221/lib/
gtts
andgtts_token
(gtts_token
is no longer needed for2.2.1
)gtts
folder from (1) to thislib
folder.It should now work without problems. It's even faster than before.
Originally posted by @psii in #161 (comment)
The text was updated successfully, but these errors were encountered: