Anki Forums

Disabling audio autoplay for certain fields


I would like to add to my cards an example sentence audio that is not played automatically when the card is displayed. I would like the play button a appear and the sound to be played only if I press the button. Is it possible to do that?

Thanks in advance

1 Like

I’m afraid this is not currently possible to control on a per-field basis - but there is a setting in the deck options to disable or enable autoplay for a given deck.

You can add this script in front template, as a result, the sound that is specified in the template first, pronunciation of a word for example, will be played. Other files will not play.


onShownHook.push(function () {

  typeans = document.getElementById("typeans");

  if (typeans) {





Unfortunately, it did not work. But I found another code on Reddit that worked:

  var elem = document.querySelector(".soundLink, .replaybutton"); // AnkiMobile & AnkiDroid / AnkiDesktop
  if (elem) {; }

But the problem with this code is that, when you disable the autoplay, it still plays the first audio. Is there a solution for this? Thanks in advance.

Many thanks for this solution: I had been looking for a solution to playing first audio on a card. Finer control on a per-field basis would be great (one for the wishlist perhaps?)

I am not really good with codes but I have found some links that might help you: