Audio cuts out at the end

This only happens on the desktop version and only when I’m using my Focusrite Scarlett 4i4 audio interface as my default sound device.(not bluetooth) I don’t have this issue when I use my monitor as the default audio device. It’s random. It used to happen sometimes, and not happen at certain times. When it would happen, it would only happen to certain audio tracks. This time, the issue won’t go away and a restart won’t fix it. I see absolutely no pattern regarding the audio tracks that get cut out and those that do. Some are from forvo, some are from anime, some from other places. All mp3

I used to be on version 2.1.45, but I updated to:
Version ⁨2.1.50 (26d40c3a)⁩
Python 3.9.7 Qt 5.15.2 PyQt 5.15.5
to see if it would fix it, but it didn’t. If possible, I don’t want to update to something too recent and risk messing up my addons, etc.

I had this issue for a while now and I’m completly lost. Since it won’t go away, I mostly do anki on my phone, which is not as good imo. I also can’t check the audio quickly when I’m creating cards.

It’s probably caused by the underlying mpv issue on Windows.

The latest Anki version includes a workaround that adds 150 ms of silence to the end.

To apply it for Anki 2.1.50, try running this code in the debug console (or manually create mpv.conf with af-add=lavfi=[apad=pad_dur=0.150] in the %APPDATA%\Anki2 folder and restart Anki).

https://docs.ankiweb.net/misc.html#debug-console

import os
from aqt import mw
from aqt.sound import mpvManager
with open(os.path.join(mw.pm.base, 'mpv.conf'), 'a') as f:
    f.write('af-add=lavfi=[apad=pad_dur=0.150]\n')
print('[af] before:', mpvManager.get_property('af'))
mpvManager.shutdown() # restart mpv to apply new settings
print('[af]  after:', mpvManager.get_property('af'))
3 Likes

I didn’t even know the debug menu was a thing! I entered the code as you instructed and it no longer cuts off. Thank you so much!! I’ve been googling about this issue for months now. It’s a big relief

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.