Selective autoplay of audio for certain notes

You can copy the code for the default Anki audio button and replace the onclick code in it with the one you need to make an audio button of your own:

<a class="replay-button soundLink" href="#" onclick="YOUR ONCLICK CODE HERE">
    <svg class="playImage" viewBox="0 0 64 64" version="1.1">
        <circle cx="32" cy="32" r="29"></circle>
        <path d="M56.502,32.301l-37.502,20.101l0.329,-40.804l37.173,20.703Z"></path>
    </svg>
</a>

I’m not sure, how it will look on AnkiDroid though. Might be a bit tricky to make the same code match the default styles on both platforms at the same.

1 Like