How to detect when audio starts and ends playing


I would like to add some visual effects when the audio is playing, and I was wondering if there is anyway of detecting this, either with a JS event or by at least having the length of the Audio and estimate based on time from load or from click. Otherwise I will have to create my own Audio button + JS logic but I would like to avoid it.

Thank you in advance.

You probably have to write an add-on for that.

Check an example of how this add-on highlights the currently played audio:

1 Like

Thank you for the help @abdo, unfortunately I also use AnkiDroid or at least I try to keep the cards compatible so unfortunately addons are not an option.

A JS solution should be possible if you use the <audio> element instead of Anki’s [sound] syntax.

Yes I am aware of this solution, I list it in the original question, thank you in any case.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.