Flacenstein: FLAC librarian and transcoder
Flacenstein is meant to do two things: rip CDs and store them in single FLAC files, and convert subsets of those FLAC files to any destination format you want.
When it rips a CD, it stores the cuesheet in the FLAC CUESHEET block, it stores the tags (artist, album, track titles, etc) in the VORBIS_COMMENT block in the current fashion, and it stores the CD cover image in an APPLICATION block, using my flac-image program. The point is that there is only one file to keep track of, and that file contains all of the information that it is reasonably possible to extract from the CD. No matter what new compression formats might be invented, there should be no need to ever take the CD off the shelf (or out of storage) again.
Some non-portable player devices directly support FLAC (such as the excellent Squeezebox), and you can use your new FLAC library as is. But devices with relatively limited storage, like the iPod, work much better with whatever compressed format is native to them. Flacenstein displays a list of all your FLAC albums, from which you can select any subset and have them automatically converted. Output formats are handled through plugins; the ones I have supplied are for Ogg Vorbis, mp3 (via lame), and MPEG-4/AAC (via faac). The MPEG-4/AAC (.m4a) files that Flacenstein creates are compatible with the iPod, and even contain the cover art.
Flacenstein can run an arbitrary number of encoding jobs in parallel, so if you have access to multiple CPUs (e.g. an SMP machine, or through MOSIX), you can realize an almost linear speedup. Using 12 threads on an OpenMOSIX cluster of Pentium 4 machines at work, I am easily able to dump 500 albums into about 30G of m4a files in a few hours.
I have to convince you to try this out before you see that list of dependencies, so here is some more bait:
There are quite a lot of programs and libraries that flacenstein needs, but if you are hacking on digital music, you probably already have most of them lying around. If you know how to use subversion, check out the up-to-the-minute program files that I am using from:
https://svn.cs.pomona.edu/sys/src/flacenstein
Otherwise, here is a snapshot .tar.gz that I just made. It may be out of date when you read this, but it has the advantage that I happen to know that flacenstein is working today:
flacenstein-20051023.tar.gz (53k)
You may consider any files that you check out from the above subversion URL, or any files in the above tar ball, to be licensed to you under the GNU GPL version 2, unless otherwise noted.
Generally you will start flacenstein by saying python flacapp.py. If it doesn't work, read on about the many dependencies.
Boy howdy. From the beginning:
Flacenstein is written in Python, so before anything else you will need the Python interpreter. I used Python 2.3, so Python 2.4 should also be fine if that's what you have. This, at least, is easy to get.
Python homepage - Debian package: python
wxWidgets is a cross platform GUI library, and wxPython is the set of bindings that let you use that library inside Python. Either wxPython 2.5.3 or 2.6 should be OK. Note that wxPython is going to depend in turn on the binary wxwidgets library for GTK.
wxPython page - Debian package: python-wxgtk2.6
pyflac is an interface that lets Python programs manipulate FLAC files, so obviously it's pretty important to Flacenstein. Unfortunately parts of it have to be natively compiled on your system, or I would just include it.
Fortunately for me, the guy who wrote pyflac has packaged it for Debian, but I don't know of anywhere else to get it.
Debian package: python-flac
If you have made it this far, and your Python interpreter is able to locate the wxpython and pyflac modules, you should now be able to start Flacenstein with
python flacapp.py
and at least get a window to appear. It won't be able to do much yet, since there are still about a thousand more dependencies to install.
Although Flacenstein uses pyflac to monkey with FLAC tags in some cases, it just calls the FLAC encoder directly when ripping (lame, I know). So, you will need the FLAC package and the header files in order to compile the next thing, flac-image.
FLAC home page - Debian packages: flac libflac6 libflac-dev
I wanted to be able to store the cover art images as metadata blocks directly in the FLAC file, which Josh's metaflac program doesn't directly support, so I had to write my own, which is right here.
If you want to rip CDs, you need the cdparanoia binary in your $PATH. The paranoia library tries much harder than most rippers to correct jitter, skips, and all the other things that tend to go wrong. So far it is able to handle all of the lame-ass copy protection and crippleware schemes that I have run into.
The price is that cdparanoia takes much longer than some rippers, but if you want to make imperfect copies in exchange for speed, it's probably silly to be fooling around with FLAC at all.
libparanoia home page - Debian package: cdparanoia
The ripper connects to the musicbrainz database to automatically identify CDs when it can, so you will need the python-musicbrainz module. This is already a Debian package.
musicbrainz page - Debian package: python2.3-musicbrainz
If you want to export FLAC albums to mp3s, you need the lame binary somewhere in your $PATH. If you don't have it, flacenstein will handle it gracefully, the mp3 export option will just be disabled.
Getting lame is a pain because of the US patent encumbrances on the mp3 format. You might have to compile it yourself, or get Debian packages from http://www.rarewares.org.
LAME home page - Debian package: lame (see above)
If you want to export FLAC albums to Ogg Vorbis .ogg files, you need the oggenc binary somewhere in your $PATH. This is easy to find, since Ogg was designed specifically to avoid all the patent problems with mp3.
Ogg Vorbis home - Debian package: vorbis-tools
If you want to export FLAC albums to MPEG4/AAC files (.m4a), you need the faac binary somewhere in your $PATH. You will have to compile it yourself or go to rarewares.org for binary packages, as for MP3.
The .m4a files that flacenstein produces use the AAC audio codec with the "low complexity" profile, which is the type that is compatible with iTunes and the iPod. A thumbnail of the cover art image will be stored in the .m4a if the image is available in the FLAC file, which is neat.
Note that flacenstein can't actually put the m4a files onto your iPod. For that you will want gtkpod or yamipod or something else.
FAAC information - Debian package: faac (see above)
#