Closed topherbuckley closed 1 year ago
Hi, I don't think this has been explored beforehand. Anki flashcard have a HTML content, but I am not aware of any HTML tag which would force Anki to use Google TTS to read the contents of that tag. Something like <a href="ttl:saythis">foo</a>
- I'm totally making this up, but perhaps Anki supports something like this? Let's do a bit of a research whether there's a way to attach a TTS to Anki flashcard.
Apparently this is handled in different ways depending on which platform you're using Anki on:
https://faqs.ankiweb.net/text-to-speech-support.html
For Ankidroid:
https://docs.ankidroid.org/manual.html
(See the Text to Speed header).
So something like this:
<tts service="android" voice="en_GB">{{EnglishTranslation}}</tts>
looks to be the syntax. I guess this would be something we add in Ankidroid to our card types for a given Options Group and when we import from Aedict we can use a deck that uses that Options Group. I can try later. If so, I don't think it would require anything further from your end.
Sounds good, thank you so much for your research. We can definitely change the default templates in Aedict if need be; even though for compatibility reasons we could leave them as-is and the user can modify the templates themselves. Just curious: is the text wrapped in the <tts></tts>
element visible on-screen, or is it replaced by, say, a loudspeaker button which performs the TTS?
No problem. Fiddled around with it just now and note that its a little clunkier than expected:
https://www.reddit.com/r/Anki/comments/eg867t/tts_not_working_with_tags_on_ankidroid/
But in summary, yes the text wrapped is visible and there is no loudspeaker button or otherwise control (it automatically reads whatever text is wrapped).
Yeah, I think this doesn't have to be done on the Aedict end of things. The fields exported from Aedict can remain the same, Ankidroid users just have to setup a new options group and export to a deck that uses that options group.
As a feature idea, how hard would it be to export the TTS to a Anki flashcard? Ideally Anki also has some API rendering a Google generated TTS so we wouldn't have to store the audio file locally, but that would also work as a possible workaround. Just curious if this has been explored before as I didn't see anything in the existing issues on it.