AwesomeTTS / awesometts-anki-addon

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

AwasomeTTS speaks text twice when reviewing cards. #255

Open EugeneTarasenko opened 2 years ago

EugeneTarasenko commented 2 years ago

When I try to use this code {{tts en_US voices=AwesomeTTS:Answer}} to speak the answer it speaks the text once when editing/previewing a card, and, for some reason, twice when reviewing. Is it a bug, is there any way to fix it and prevent speaking the text twice?

https://user-images.githubusercontent.com/87163666/161663042-4d3d785e-d676-4221-9817-240ab76eafd5.mp4

luc-vocab commented 2 years ago

can you share your card templates ?

EugeneTarasenko commented 2 years ago

Sure.

Back Template:

<div class="text">
    Голицынский Ю.Б – Грамматика
    <br>
    АРТИКЛЬ
    <br>
    {{Exercise number}}
    <br>
    {{Exercise task}}
</div>

<div class="divider"></div>

<div class="text">
    {{cloze:To solve}}
    {{type:cloze:To solve}}
</div>

{{tts en_US voices=AwesomeTTS:Answer}}

<div class="divider"></div>

<div id="myButton" style="margin: 1rem 1rem; text-align: center">
    <button onclick="myFunction()">Показать правила</button>
</div>

<div id="hint" style="display: none">

<div class="text">
    {{edit:Hint}}
</div>

</div>

 <script>

    function myFunction() {
    var x = document.getElementById("hint");

    if (x.style.display === "none") {
        x.style.display = "block";
        document.getElementById("myButton").style.display = "none";

    } else {
        x.style.display = "none";
    }
}

</script>

Fields:

Screen Shot 2022-04-05 at 05 13 40

Card example:

Screen Shot 2022-04-05 at 05 15 04

Back:

Screen Shot 2022-04-05 at 05 19 45

I'm using an old 1.46 version of AwasomeTTS. Can this problem occure because of the old version?

luc-vocab commented 2 years ago

From the card template, i don't see anything wrong, so it's not clear to me why you're hearing the audio twice. You could try debug logging to file if you understand how to set it up: https://github.com/AwesomeTTS/awesometts-anki-addon/wiki/Debug-Logging is there something preventing you from upgrading to the latest AwesomeTTS?

EugeneTarasenko commented 2 years ago

@luc-languagetools, I have just updated it to the latest version 1.60 but the problem still remains.

https://user-images.githubusercontent.com/87163666/161672613-ed1aff7a-8de7-42bb-8289-5ad0659b9548.mp4

Nevertheless, thanks for your attention and replies.

luc-vocab commented 2 years ago

what about the debugging logging method I suggested, are you able to try that ?

EugeneTarasenko commented 2 years ago

@luc-languagetools What command should I use and what kind of information should I retrieve? Is there a comprehensive guide to using the debugging logging feature?

Screen Shot 2022-04-05 at 07 15 29
luc-vocab commented 2 years ago

can you try following these instructions ? https://github.com/AwesomeTTS/awesometts-anki-addon/wiki/Debug-Logging

EugeneTarasenko commented 2 years ago

Yes, I did. What should I do next? What commands should I enter after that?

Screen Shot 2022-04-05 at 08 08 46

Entering the log help command gives me a list of suggested commands. Which command should I use to get logging data?

161677858-b402090e-69e7-4374-b063-71e40eb982a1
luc-vocab commented 2 years ago

here i'm a bit less familiar, are you attempting to run the Anki command ? Does the Anki application start up ? And did you set the require environment variable ? I'm planning on getting a hold of a mac soon to try to make this whole process easier.