Make play audio button a toggle

Hello everyone. Thank you for Anki!

I use ankidroid

Is it possible to make tts or audio autoplay button togglable? now it’s “play only” which is annoying if audio is long (e.g. an example for some word, etc).

can it be a toggle “play/pause” so audio will stop when button pressed 2nd time, and resumed on 3rd time etc?

This seems won’t change any behavior in current realization but definitely will improve ux to provide an option to stop playback if necessary.

Right now the only way to stop the playback is to turn the screen off or minimize the app or set volume to minimum. So these methods are indirect and inconvenient.

Thank you so much for Anki once again.

1 Like

Anki would suggest this, but Ankidroid would have to do it :slight_smile:
When the audio is short, it’s fine, but I agree with long ones, it’s inconvenient. Of course, you’re supposed to listen to everything, but often I don’t listen anymore because someone said something important at the beginning and I move on to the next card.
Something like this could be done in your own design, but it’s not easy for ordinary people.

There is a workaround: if you add another audio on the card pointing to an empty file, pressing it will interrupt any current playback, serving as a stop audio button.

3 Likes

You don’t even need an empty audio file: you can use an empty static tts tag. I use this which puts the button in a fixed place:

<div style="position: fixed; bottom: 60px; right: 5px;">
[anki:tts lang=en_US voices=com.google.android.tts-en-US-language][/anki:tts]
</div>

Btw, there was a PR implementing this which unfortunately doesn’t look like it’ll ever be merged. See also my topic Add audio actions.

3 Likes

Thank you @Eltaurus

Thank you @ZornHadNoChoice

For your replies and advices

That’s sad if it might not be done in the straightforward way without workarounds. But definitely it’s nice to have some suggested by you.

Have a great time. Cheers.

1 Like

Thank you @kaiu that’s way I also was doing with the King ones. But stopping the audio without going to the next cards still feels like a nice to have option.

Have a great time. Cheers