Use python with Pydub to trim your mp3
Because you can? How to install pydub and then a few lines of python to trim the mp3
Why would I want to trim my mp3?
Maybe there’s silence at the beginning or end of the mp3.
Maybe there’s a ten minute gap before a secret song.
Or maybe you would like to customize your I’m-busy-and-focusing-please-don’t-bother-me playlist.
I have to admit that my motivation was the latter. I often listen to music when I attempt to focus. To keep away distractions, I prefer if one song starts as soon as the next song ends.
Whatever your reason is, thanks to the developers of pydub there is a simple way to trim your mp3 with python.
How to install pydub
Installing pydub is more difficult than actually using pydub.
I would recommend reading through the GitHub page for pydub before starting the installation. Otherwise, you might find yourself troubleshooting error messages.
First, pydub has the dependency of ffmpeg or libav. The GitHub for pydub suggests using brew to install ffmpeg. You might read elsewhere that pip can install ffmpeg also, but unfortunately I read the pip suggestion first and ran into trouble. In the end, I tried the brew install and that worked for me.
How to trim the mp3
To get started, open a song with pydub python. Then you can play the song and decide which seconds (or milliseconds) that you would like to trim.