Is your feature request related to a problem? Please describe.
I have a couple of cards with multiple audio recordings - mostly one with the vocabulary and then a bunch of example sentences. While I prefer to have the sole vocabulary to be read-out, having auto-play of all sentences is just annoying…
Describe the solution you’d like
It would be great to have field configuration option in NoteType which would controll if the audios of particular field should be auto-played or not.
Describe alternatives you’ve considered
There is a bunch of topics with various hacks/workarounds (mostly using <script/> to do that but it just feel so fragile. Having an option right there would be way better.
An alternative implementation has additional attributes for [sound:] and [anki:tts][/anki:tts], which could be used to specify whether the sound should be played automatically or not.
I would REALLY appreciate having this as an option. Currently, having sound in example sentences makes using Anki quite annoying as the sound from the example autoplays and quite often trigger recollection from the context…
But how would you decide on that? Without too much hassle?
In my case - I add audio using AwesomeTTS plugin, which inserts [sound:…] tag. How would you like to handle that? You mentioned using special attributed on divs for example, but IMHO that while it may give you a lot of flexibility it’s not very user-friendly…
If you want user-friendlyness you can have something like [no-play:sound: ] but divs of course are more flexible as you can make template changes with it. And also disable auto-play on whole fields.
This does not work with tts and individual audio files.
Ideally, have a special class instead.
<span class="muteAudio">{{Audio}}</span>
<span class="autoplayAudio">{{Audio}}</span>
<span class="muteAudio">[sound: ]</span>
<span class="autoplayAudio">[sound: ]</span>
<span class="muteAudio">{{tts en_US:Front}}</span>
<span class="autoplayAudio">{{tts en_US:Front}}</span>
<span class="muteAudio">[anki:tts lang=en_US] This text should be read. Here is {{Field1}} and {{Field2}}[/anki:tts]</span>
<span class="autoplayAudio">[anki:tts lang=en_US] This text should be read. Here is {{Field1}} and {{Field2}}[/anki:tts]</span>
This still requires dabbing in sources of (cards/templates) and if you want to globally disable autoplay for audio in a field then you would have to do search&replace – I’d argue somewhat inconvenient.
There is another issue at play here - how to handle two-level auto-play configuration (eg global and per-field)?
What do do if you have per-field auto-play on but disable it globally - should the fields that have it on play automatically still?
In some UI widgets you have tri-state checkbox (off/on/between, which may mean impartial selection). Qt does seem to support that (QCheckBox - Qt for Python) so maybe using it with the intention:
settings on/off (globally)
per-field tri-state (on - always autoplays; partially checked - follows global; off - always off)
Isn’t that more complicated for no reason? Plus, it’d be completely useless for me because I share my decks on AnkiWeb. I can imagine the downvotes from “audio plays automatically and I can’t change it in deck options. fix it”.
Though, to be honest, I doubt my suggestion would solve my issue with randomly playing a file. We need someone who knows how the code works to come up with an idea.
people are dumb in my country, won’t work lol. but to be serious, it actually won’t work. the templates are fairly complex and took me a lot of time to understand even with my somewhat decent understanding of HTML etc.