# End of sound files clipped

**URL:** https://forums.ankiweb.net/t/end-of-sound-files-clipped/17113
**Category:** Help
**Created:** [January 28, 2022, 8:36am UTC](https://forums.ankiweb.net/t/end-of-sound-files-clipped/17113 "2022-01-28T08:36:51Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![kelciour](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kelciour/32/14770_2.png) [@kelciour](https://forums.ankiweb.net/u/kelciour)
#### Post date: [January 28, 2022, 2:01pm UTC](https://forums.ankiweb.net/t/end-of-sound-files-clipped/17113/2 "2022-01-28T14:01:17Z")

</div>

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

> [@Audio tracks get clipped at the end](https://forums.ankiweb.net/t/audio-tracks-get-clipped-at-the-end/10289/8):
>
> Another update! The solution I shared in the previous post actually lead to some other issues later down the road, mainly audio clips not playing from the very beginning (something to do with loading? no idea). I have went ahead and installed every driver I could find, including updating my bios, but nothing seemed to work, until I revisited the article I had linked and noticed that the ‘audio enhancements’ tab it speaks off, which I hadn’t been able to find, is actually a single checkbox under…

> **[Turn off or Disable Audio Enhancements in Windows 10](https://www.thewindowsclub.com/disable-audio-enhancements-windows-10)**
>
> To resolve audio or sound issues, you may turn off or disable Audio Enhancements in Windows 10. Do this if you’re sure that your audio driver is up to date.

If you were on Ubuntu,

> [@Sound file clipped](https://forums.ankiweb.net/t/sound-file-clipped/11361/4):
>
> If my theory is correct, and this is an Ubuntu problem, then this is the solution: It is an internal problem with the Pulseaudio package, which is built into recent Ubuntu versions. Dr\_Evil’s solution worked fine for me. On Ubuntu 20, you will need to run default.pa as sudo (sudo gedit /etc/pulse/default.pa) and then restart your machine.

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.

> **[GitHub - anars/blank-audio: Set of blank MP3 audio files](https://github.com/anars/blank-audio)**
>
> Set of blank MP3 audio files. Contribute to anars/blank-audio development by creating an account on GitHub.

* * *

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](https://docs.ankiweb.net/misc.html#debug-console)

- 1 second

```auto
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

```auto
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](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.

```python
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'))

```

---

_[View the full topic](https://forums.ankiweb.net/t/end-of-sound-files-clipped/17113)._
