Anki Doesn't Play Audio on Arch Linux for Chinese Support Cards 3 [SOLVED]

Hello Everyone,

For quite a while I have been having an issue where the audio generated from the add-on Chinese Support 3 would not play after answering a card. This would only happen specifically only on Arch Linux for both the AUR anki-bin and flatpak versions. I could make the flashcards, but could never get the sounds to play back. They would work on other distros, as well as on the Android app.

I initially thought this issue was with mpv or mplayer, and tried following various guides to getting it fixed such as the ideas found on this anki web forum post but nothing ever worked. However today I just found a solution and wanted to let everyone else running into this problem know the solution.

The issue is not with mpv, or mplayer, or any audio related systems, in fact, it is simply just a problem with the template of these Chinese Support 3 pre-made cards. Looking into the template, the Sound field is wrapped in a comment, which for my slightly modified cards looks like this:

<div class=tags>{{Deck}} {{#Tags}} -- {{/Tags}}{{Tags}}</div>


<div>{{English}}</div>
<hr>

<div class=chinese>{{Color}}</div>
<div class=reading>{{Pinyin}}</div>
<hr>
<div class=basic-chinese>{{Hanzi}}</div>
<hr>
<div class=notes>Notes:<br>{{Notes}}</div>

<!--{{Sound}}-->

Now I don’t understand why only Anki on Arch Linux actually follows this tag, but apparently everywhere else still plays the sound on reveal regardless. But if I remove this tag and just leave it as {{Sound}} (without the enclosing <!-- -->), everything actually works as expected!

Hopefully this prevents someone else from going down the many rabbit holes of fixing mpv and mplayer.

This was changed recently so that commented out fields don’t really work (there was probably a version mismatch between your other devices and this one). If you want to hide the play button, you can use CSS to do that instead of this.

1 Like

The “commented out” audio field replacement is the culprit – as of version 25.02 – not the OS.

For more:

1 Like