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.