7

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
  • 71
  • 1
  • 1
  • 3
  • Just restarting the app fixed this for me. (Have used Anki with audios for a long time, no issues, started seeing this today out of nowhere.) – Freewalker Feb 08 '22 at 18:48

3 Answers3

12

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,000
  • 24
  • 132
  • 201
Tanmay
  • 129
  • 4
2

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
  • 146
  • 3
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
  • 2
  • 7