Audio issues with bluetooth headphones

Hi,

I have Airpods Pro connected to my desktop via Bluetooth. When I play audio from cards, the first second or so of the audio clip is completely cut off. Even if I hit replay audio immediately after hearing it, the audio still gets clipped off. If I play the same clip in Anki via speakers, it plays fine. I also played the same clip via Audacity and VLC with the bluetooth headphones and it doesn’t have the issue – it’s specific only to the audio player within Anki.

I found a plugin that supposedly addresses this by constantly playing a silent audio clip in the background but that didn’t resolve the issue for me.

Any ideas?

1 Like

It’s just a guess, but maybe try to update mpv from 0.27 to 0.32.

  1. Close Anki.

  2. Download mpv-0.32.0.tar.gz from https://laboratory.stolendata.net/~djinn/mpv_osx/ and unpack it somewhere.

  3. Right-click on mpv.app and select “Show Package Contents”. Then go to mpv.app/Contents/MacOS.

    If “Show Package Contents” can’t be found, maybe it’s only available if app is installed, maybe try to rename mpv.app or maybe try to access its content with “Go to location”, i.e. press Cmd+Shift+G and type the full path to the mpv.app or to the Contents subfolder.

    https://apple.stackexchange.com/a/310799

  4. Find Anki in the Applications folder.

  5. Right-click on Anki.app and select “Show Package Contents”. Then go to Anki.app/Contents/Resources/audio.

  6. Remove mpv and lib from this folder, i.e. Anki.app/Contents/Resources/audio, and replace it with mpv and lib from mpv.app.

  7. Then restart Anki, open the Debug Console, copy-paste the following lines and press Command+Return. This is just to make sure that mpv version is 0.32.

    https://docs.ankiweb.net/#/misc?id=debug-console

    from aqt.sound import mpvManager
    print(mpvManager.get_property("mpv-version"))
    
  8. And try to review a few cards with Airpods Pro.


If updating mpv to 0.32 won’t work, try to create mpv.conf in the Anki2 folder with these two lines.

audio-stream-silence=yes
audio-wait-open=2

https://mpv.io/manual/master/#options-audio-stream-silence

On Mac computers, recent Anki versions store all their files in the ~/Library/Application Support/Anki2 folder. The Library folder is hidden by default, but can be revealed in Finder by holding down the option key while clicking on the Go menu.

https://docs.ankiweb.net/#/files?id=file-locations

Restart Anki and try to review a few cards.

Just to make sure that mpv.conf had been created correctly, i.e. not something like mpv.conf.txt, maybe open the Debug Console in Anki and run the following commands to make sure it’s set to True.

from aqt.sound import mpvManager
print(mpvManager.get_property("audio-stream-silence"))

Alternatively, just to quickly test the previous changes without creating mpv.conf, run the following commands in the Debug Console and try to review a few cards.

from aqt.sound import mpvManager
mpvManager.set_property("audio-stream-silence", True)
mpvManager.set_property("audio-wait-open", 2)
print("audio-stream-silence:", mpvManager.get_property("audio-stream-silence"))
print("audio-wait-open:", mpvManager.get_property("audio-wait-open"))

It it won’t help, try to install the alternate Anki version. It ships with mplayer and maybe it’ll behave a bit differently.

5 Likes