I’ve written a Python script that converts audio files from Apple Lossless (.m4a) to FLAC (.flac) format. Crucially, it copies meta-data, with the exception of the cover art (for now at least).
I’ve got about 1000 tracks in Apple Lossless (.m4a) format, all ripped from my CDs. Tools like MPlayer now support it, and Amarok can play them, so why bother converting them? Well, for a long time they were not supported so I could only listen to them on my Mac. I’ve also realised, if I’m going to keep a music collection on my computer, that the format I choose better be open so I can still listen to my tunes in a decade.
You’ll need the following:
- Python 2.4 or later.
- Mutagen is a pure-Python meta-data library, and I wrote the script using version 1.8.
- MPlayer is used to convert from Apple Lossless to WAV. I was using version 1.0_rc1.
- FLAC of course, to encode the WAV. My machine has version 1.1.2-r8 installed.
So far I’ve only tested the script with one Moloko album on a Linux machine. It’ll probably work just fine on any Unix-like OS, and may just work on Windows if you peddle hard. I’m going to convert all 1000 tracks soon, but first I need to find some disk space. My advice: take backups, because there are no warranties, and, though I don’t mean to scare you, the pieces are yours to keep if things break.
Happy converting, and try the magic --help switch if you’re lost.
[Edited to fix broken link, 2009-07-06]