AwesomeTTS / awesometts-anki-addon

AwesomeTTS text-to-speech add-on for Anki
GNU General Public License v3.0
484 stars 100 forks source link

No audio in card explorer if note starts/ends with cloze tag. (with a "fix") #202

Open mrmo123 opened 3 years ago

mrmo123 commented 3 years ago

I had an issue when generating an audio file. The add-on ignores cloze-tag if it comes at the very beginning or very end.

Screenshot 2021-04-20 172326

I fixed the issue by removing these two lines of code. text.py Line 277: text = RE_ELLIPSES_LEADING.sub(' ', text) Line 278: text = RE_ELLIPSES_TRAILING.sub(' ', text)

This has worked for my purposes. However, I understand that it will have some downstream effects involving other portions of your add-on.

Thanks again for the well written/commented code. It was easy for me to find the bug! Wonderful add-on!

luc-vocab commented 3 years ago

Were you using batch generation or on-the-fly ? Not clear what your expectation is and what the actual result was.

mrmo123 commented 3 years ago

Batch generation. If a note begins with or ends with a cloze (combined situation in the aforementioned image), AwesomeTTS will don't recognize the cloze. It will recognize the cloze if there is a hint (e.g. {{c1::answer::HINT}}.

Forgot to mention, in the settings (Handling text from a note field), I'm converting ellipses (...) to the word "blank." image

There is no issue with on-the-fly, with the same settings (ellipses (...) to the word "blank").

luc-vocab commented 3 years ago

If you are using cloze cards, I would recommend you use on the fly TTS. See here for how to set it up: https://languagetools.anki.study/tutorials/awesometts-on-the-fly-tts

roytruelove commented 3 months ago

Was able to replicate this