ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.77k stars 2.25k forks source link

[BUG]: TTS selector rendering text outside the specified Field identifier #14070

Closed edolis closed 1 year ago

edolis commented 1 year ago

Checked for duplicates?

What are the steps to reproduce this bug?

I am trying to use the TTS tag to render a Back field according to the instructions provided in the manual. I am using a Basic:type flashcard and I need to have TTS render the pronunciation in Ukrainian of the "Front" word (in the example "Taktika" This is the template I am using for the card:

{{Back}}<br>
<tts service="android" voice="uk_UA">
{{Front}}
</tts>

<hr id=answer>
<div class=typein>
{{type:Front}}
</div>
 <br>
<div class=notes>
{{notes}}
</div><br> 
<div class=example><em>Examples: </em> {{example}}
</div> 
<div class=notes>
<em>Synonyms: </em>{{synonyms}}<br>
<em>Etymology: </em>{{etymology}}
</div>

image

Expected behaviour

I'd expect the TTS be rendered just for the workd Taktika

Actual behaviour

The TTS engine starts syntethizing in Ukrainian all the text following Taktica instead (from the IPA pronunciation to the end of etymology)

Debug info

AnkiDroid Version = 2.16.0beta4

Android Version = 9

ProductFlavor = play

Manufacturer = Xiaomi

Model = Redmi Note 5

Hardware = qcom

Webview User Agent = Mozilla/5.0 (Linux; Android 9; Redmi Note 5 Build/PKQ1.180904.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/113.0.5672.162 Mobile Safari/537.36

ACRA UUID = 031de7fb-45a1-4837-979c-6d0ba41196d5

New schema = false

Scheduler = std2

Crash Reports Enabled = true

DatabaseV2 Enabled = true

(Optional) Anything else you want to share?

No response

Research

welcome[bot] commented 1 year ago

Hello! 👋 Thanks for logging this issue. Please remember we are all volunteers here, so some patience may be required before we can get to the issue. Also remember that the fastest way to get resolution on an issue is to propose a change directly, https://github.com/ankidroid/Anki-Android/wiki/Contributing

brishtibheja commented 1 year ago

Just a temporary solution which have worked for me in other situations is using the tag with no text embedded in it. Anki will try to read the text in tts from the back of the card but will fail because contains no text.

edolis commented 1 year ago

thanks - not sure if I understand though. If the goal is having no TTS on the back, I can just select No Speech when prompted for the language selector on the back card. Is your solution going to have the тактика word pronounced, instead?

brishtibheja commented 1 year ago

I think I don't understand the problem now. The issue that I encountered was different actually. Here I thought you do not want everything from the back of the card converted to speech. But "No Speech" option wasn't working. Anyways, I see your code uses tts on {{Front}}. But it's used on the back template. Why don't you try including the field that contains the Ukrainian word in the back template and use tts on that?

edolis commented 1 year ago

the Front field is the one spacifying the word Taktika. Even if I change it to Back (conceptually wrong, as Back contains Tactics) the problem is the same, unfortunately.

brishtibheja commented 1 year ago

the Front field is the one spacifying the word Taktika. Even if I change it to Back (conceptually wrong, as Back contains Tactics) the problem is the same, unfortunately.

You are not being clear. What did you change in the back? What has happened this time? Did the tts converted everything in the back to speech again? Correct me if I am wrong but you don't seem to understand. I suggested you not to use tts on the Front field even if it contains Taktika. Have a second Taktika at the back of your card (you can make it transparent if you want) and use tts on that.

I don't know if this will work but you can also try using tts tag on things you don't want in speech. Just specify the play speed as zero. This is stupid and I've never tried it really. But you need to be crazy enough to be innovative. So try it anyway.

Edit: @edolis I'm not a programmer so maybe you are clear but I don't understand. All I know is basic html from school.

dae commented 1 year ago

Issue is unclear. If it persists after 2.17 (alpha) is released, please create a new issue.