Hi everyone,
I’m using an older version of AnkiDroid on my old device (it doesn’t support newer versions - this may be the case with newer versions as well).
I installed the AwesomeTTS add-on on the desktop and use it on-the-fly.
Recently, I added some extra fields to my card templates for TTS functionality, but I encountered two issues on AnkiDroid:
The same information gets displayed twice.
AnkiDroid’s TTS reads the content twice as well.
To fix the display issue, I wrapped the field in a div like this:
<div class="desktop-only">
{{tts en_US voices=AwesomeTTS:Front}}
</div>
I also added the following CSS to hide the field on AnkiDroid:
.desktop-only {
display: none;
}
.linux:not(.mobile) .desktop-only {
display: block;
}
This partially worked—the content now displays only once, but AnkiDroid’s TTS still reads it twice.
Does anyone know how I can keep the field functional for AwesomeTTS on the desktop but completely disable it on AnkiDroid (so it’s neither visible nor read by AnkiDroid’s TTS)?
Thanks in advance for your help!
1 Like
You didn’t show us what you’re using for the AnkiDroid TTS, but is it safe to assume there’s some 2nd thing, and that’s what is causing it to be read twice? Are you using the old-style <tts>
tags? If so, have you tried the regular workaround? AnkiDroid User Manual
You also didn’t say how old a version you’re using. AnkiDroid has supported the same {{tts}}
tags as desktop Anki (and AwesomeTTS) since version 2.17. Are you sure you need 2 separate TTS lines for this?
If you can combine them, you should be able to list voices and fall-back voices in a single tag – Field Replacements - Anki Manual – and that might avoid the repeating problem.
1 Like
Thanks for your reply and the helpful suggestions!
I use CyanogenMod 10.2 (probably equivalent to Android 4.3), and as far as I know, the latest version of AnkiDroid I can use is 2.14.6.
I’ve never used tags before.
In AnkiDroid preferences, under the Advanced options, I checked “Text to speech,” which says: “Reads out question and answer if no sound file is included.”
I guess I need to find a way to completely hide AwesomeTTS’ tag from AnkiDroid’s TTS functionality, since 2.14.6 doesn’t seem to support TTS tags.
If you have any advice on how to achieve this, I’d really appreciate it!
Thanks again for your help!
Is this not working for you? I can’t think of any reason this wouldn’t be compatible with 2.14.
Thank you for your help!
Although there was a slight misunderstanding, it seems to be working after all.
Following the article, I tried to implement this:
<tts service="AwesomeTTS" voices="en_US">
<tts service="android" voice="en_US">
{{Front}}
</tts>
</tts>
However, AwesomeTTS seems to use fields instead of tags.
I don’t know if these are the prettiest solutions, but they actually work:
<tts service="android" voice="en_US">{{Front}}</tts>
<div class="desktop-only">
{{tts en_US voices=AwesomeTTS:Front}}
</div>
{{FrontSide}}
<hr id=answer>
<tts service="android" voice="en_US">{{Front}}</tts>
<div class="desktop-only">
{{tts en_US voices=AwesomeTTS:Front}}
</div>
.desktop-only {
display: none;
}
.linux:not(.mobile) .desktop-only {
display: block; /* Show only on Linux desktops */
}