Tag Archive for 'tagging'

flacsync: Automatically Sync FLACs to MP3s

In an effort to make organizing my music collection suck less, I wrote a script to automate the process of converting my FLAC files to MP3s for when I want to listen to them with my MP3 player.

Previously, I had no way to do this in an automated way. My music collection changes rapidly, so I needed a way to convert FLACs that haven’t yet been converted (or have changed since the last conversion) to MP3s. The first step of this process is to decode the FLAC and then pipe that to an MP3 encoder.

Next, I had to extract as much tag information as I could out of the FLAC and convert it into ID3 tags. Finally, if there are image files in the directory containing the FLACs, the script automatically embeds those images into the MP3 file (and tries to determine what type of image they are).

It also has a configurable number of worker threads, so you can process the files in parallel. It keeps a database of hashed files in ~/.flacsync/db, so when you re-run it, it will only retranscode new or changed FLAC files.

You can find it here. It uses some Unix commands like find. It requires Python 2, Mutagen, FLAC, and LAME.