End of sound files clipped

Hi there,

My Anki (2.1.49) has just this week started clipping the end of playback on sound files.

It doesn’t happen to all sound files – maybe 10-20%. And it appears to happen on the first automatic play. If I subsequently click the play button the file normally plays in its entirety (but confusingly, not always- sometimes it takes 2/3 plays).

I’m at a loss as to explain it. I’ve not changed Anki in any way, my computer is new (2021 Macbook Air) and shouldn’t be slow in processing etc. etc.

Any suggestions would be gratefully received.

If you were on Windows, it might help to disable “audio enhancements”.

If you were on Ubuntu,

Since this isn’t the case, maybe try these two options.


Maybe the issue will go away with playing 1-hour-of-silence.mp3 in the background.


Maybe try to tell mpv to play a little bit of silence at the end of the file. Just run this code using the debug console and review a card or two.

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

  • 1 second
from aqt.sound import mpvManager
print('[af] before:', mpvManager.get_property('af'))
mpvManager.set_property('af', 'lavfi=[apad=pad_dur=1.0]')
print('[af]  after:', mpvManager.get_property('af'))
  • 0.5 seconds
from aqt.sound import mpvManager
print('[af] before:', mpvManager.get_property('af'))
mpvManager.set_property('af', 'lavfi=[apad=pad_dur=0.5]')
print('[af]  after:', mpvManager.get_property('af'))

If it works, apply it permanently by writing af=lavfi=[apad=pad_dur=0.5] to mpv.conf in ~/Library/Application Support/Anki2 and restarting Anki.

https://docs.ankiweb.net/files.html#file-locations

It might be a bit easier to do it using the debug console to write and apply new settings without restarting Anki.

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