10

Anki does not play audio and show error "Sound and video on cards will not function until mpv or mplayer is installed."

How can I fix it?

mpv and mplayer are installed ubuntu 20.04

Anki version is 2.1.15 (442df9d6)

Nkom
  • 101

3 Answers3

14

You need to install mplayer in your computer using these commands in the terminal:

sudo add-apt-repository universe
sudo apt update
sudo apt install mplayer mplayer-gui

After that restart your Anki. It worked for me.

Source for installing mplayer manually

jokerdino
  • 41,732
Tanmay
  • 149
5

mpv didn't work for me and mplayer-gui isn't needed. I'm on ubuntu focal 20.04 and all that was needed is

sudo apt update
sudo apt install mplayer

After that restart anki and it worked

The anki version is the version for ubuntu 20.04 which is 2.1.15 https://packages.ubuntu.com/focal/anki

Flip
  • 186
1

Change the line 107 in your file /usr/share/anki/anki/mpv.py from

        self.argv += ["--input-ipc-server", self._sock_filename]

to

        self.argv += ["--input-ipc-server=" + self._sock_filename]

as in the fixed upstream.

You'd better add the file /usr/share/anki/anki/mpv.py to local diversions lest it be overwritten by any unfixed "update". If you don't know what local diversion is, just man dpkg-divert.

dpkg-divert  --divert /usr/share/anki/anki/mpv.py~ --no-rename --add /usr/share/anki/anki/mpv.py
Lei Zhao
  • 301