Support This Project

More Examples

Ripping a CD to several MP3 files

We'll use the -t option to specify the MP3 format which will automatically trigger metadata lookup during extraction:

% cd2track -t mp3
Ripping a CD to several FLAC files

Again, specifying the FLAC format results in metadata lookup automatically:

% cd2track -t flac
Ripping a set of CDs to FLAC files

Metadata lookup will automatically add album number and album total values, if available from the MusicBrainz service. However, if that metadata is not found, we can specify it manually.

For example, when ripping the tracks from disc 1:

% cd2track -t flac --album-number=1 "--format=%(album_track_number)s - %(track_name)s.%(suffix)s"

When finished, we specify an album number for disc 2:

% cd2track -t flac --album-number=2 "--format=%(album_track_number)s - %(track_name)s.%(suffix)s"
Editing track metadata

Although MusicBrainz and FreeDB are a good sources of CD metadata, they're not quite perfect. Sometimes entries don't quite match what's on the CD, and sometimes they doesn't have any information at all. When that happens, we can use cd2track's interactive mode (specified with -I) to edit that metadata prior to ripping.

Or, we can use tracktag's interactive mode (also specified with -I) to edit track metadata after the fact:

% tracktag -I *.flac

This is an interactive, GUI program which runs in a terminal window and handles various metadata formats transparently.

Transcoding FLAC files to MP3 files

This is generally a nice, simple operation since FLAC files already have metadata:

% track2track -t mp3 *.flac

However, on nice modern PCs with many CPU cores, transcoding can be a lot faster. Spreading the same task across 4 cores requires one extra option:

% track2track -j 4 -t mp3 *.flac

Finally, let's try using all 4 cores and making the highest quality MP3s possible (preset 0, using LAME's quality setting):

% track2track -q 0 -j 4 -t mp3 *.flac
Embedding Album Artwork

Now, let's scan in the album's cover and embed it in our MP3s so that it shows up on portable players:

% tracktag --front-cover=cover.jpg *.mp3

But wait, what if we scan in a better version of that cover later? We could try tagging them again:

% tracktag --front-cover=better-cover.jpg *.mp3

But now our MP3s have 2 front covers embedded, the old one and the new one. Let's retag them to have only our new cover instead:

% tracktag --remove-images --front-cover=better-cover.jpg *.mp3
CD Image Handling

Instead of handling our album as a collection of infieldsetidual FLAC files, we might want to store it as a single CD image file. We could try simply concatenating them together:

% trackcat tracks/*.flac -o album.flac

Unfortunately, we now have no idea where the track breaks are. As far as we know, it's just one big audio track. Instead, let's try using cdrdao on our original CD to get a text file with those track breaks:

% cdrdao read-toc --device /dev/cdrom album.toc

Now, we can concatenate our individual FLACs along with the track break file:

% trackcat --cue album.toc tracks/*.flac -o album.flac

Thus, album.flac not only contains all the CD audio data, but also information about where the infieldsetidual tracks are. So, if we burn this disc image back to a writable CD, as follows:

% track2cd album.flac

Our new CD will have all the proper track breaks exactly as they appeared on the original.

But that's not all we can do with CD image files. We might also want to split it into several MP3 tracks for portable use. Since we've already embedded its track breaks, the process is pretty simple:

% tracksplit album.flac -t mp3 -d mp3_tracks/

As with cd2track, this command will automatically perform metadata lookup from the MusicBrainz and FreeDB services to determine what the tracks should be called.