kelciour / awesometts-anki-addon

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

Skipping underlined words and alternative clozes #10

Open Adriaran opened 4 years ago

Adriaran commented 4 years ago

Perhaps there's a setting for this that I haven't figured out, but I'm having 2 issues when I generate audio for a given card/note:

  1. Generated audio skips any underlined words in the note
  2. Generated audio skips other/alternative clozes in the same note (other than the one for the given card, this is for cards with 2+ clozes)

Any chance you have a solution for that? Thanks!

kelciour commented 4 years ago

At the moment I can only suggest to consult with https://ankiatts.appspot.com/config/text and use "replace w/ deleted text" option. It seems to work and can be used to generate audio for the back side of the card, but I'm not sure about any other options.

  1. It seems to work for something like

It's kind of fun to do the impossible.

but doesn't work for something like

It's kind of fun to do the __.

  1. I tried it with the following examples using "read as Anki would display on a card front" option:

We are so focused on figuring out the best approach that we never get around to taking action. As {{c1::Voltaire}} once wrote, “{{c2::The best is the enemy of the good.}}”

but it looks like it doesn't work as not one but both clozes were skipped.

Everything can be fixed, but it'd take some time and I'm afraid I have a lot of work to do, have a few unfinished projects and won't have much time left to do anything else.

kelciour commented 4 years ago

I took a closer look at the issue a few weeks ago.

Generated audio skips any underlined words in the note

It looks like Google will speak blank if there's 5 consecutive _. Another possible option is to tell AwesomeTTS to replace ___ with something else - https://ankiatts.appspot.com/config/text -> Advanced Handling. The latest version of the add-on supports SSML tags that allows to use <break time="1250ms"/> or <audio src="https://actions.google.com/sounds/v1/alarms/beep_short.ogg"/> as a replacement.

Generated audio skips other/alternative clozes in the same note (other than the one for the given card, this is for cards with 2+ clozes)

At the moment I can only suggest on-the-fly TTS either using AwesomeTTS or using Anki 2.1.20 - https://apps.ankiweb.net/docs/manual.html#text-to-speech

Kudorollin commented 3 years ago

Hello. On Azure, SSML doesn't seem to be working correctly. When I replace periods (.) into <break time="1250ms"/>, Azure immediately reads the next sentences.