I’ve taken a look at Anki’s source code and it seems like a simple modification of the “play_clicked_audio” method in the “sound.py” script to accept lists as the last argument alongside plain integers should achieve several sought for pieces of functionality for card scripts:
- stopping audio playback (by calling the ‘play’ pycmd with empty list)
- filtering out some of the audio files from the autoplay (including with an HTML tag as in your suggestion)
- repeating each audio a certain number of times (or looping of them together)
I’m not sure if such changes to the core codebase are welcome, however. Maybe you know more about that?