Ripping and Encoding Music Files

MP3 files on the Internet come from the hard drive of some person who ripped the music from CD, encoded it in MP3 format, and uploaded it to the Web using any one of a dozen methods for sharing files. It is because of this file sharing on the Internet that MP3 has become synonymous with digital music files.

Besides being able to play back MP3 files, Linux can also be used to create them. Several open source encoders are capable of creating MP3 files; one of them, LAME, is well known even in the Windows world. Many Linux users prefer to use Ogg Vorbis files instead of MP3, because OGG is an open format that produces smaller and better quality audio files than MP3.

There are dozens of tools on Linux that can be used to encode audio files; the one on Move is called KAudioCreator. To launch it, click K Menu Enjoy music and video Rip audio CDs. You'll probably be greeted with one or two warning windows. The first one complains that "No encoder has been selected"; the second one tells you that "No tracks are selected to rip." Just click OK to close both these boxes.

To rip a CD, launch the KAudioCreator program and insert a CD into the drive. In a few seconds a list of your songs, complete with track titles, should appear in the main program window, as shown in Figure 4-6. Move has configured the KAudioCreator program to connect to the CDDB database on the Internet to look up the album information. If the main window displays a list of generic tracks, either your Internet connection isn't working, or the program couldn't find your album information on CDDB.

An album loaded in the main window of KAudioCreator

Figure 4-6. An album loaded in the main window of KAudioCreator

If there is a successful lookup in CDDB, Move has also configured KAudioCreator to automatically start ripping your CD. This is a very bad default behavior for a live CD setup, because each song you rip will take up space on your USB key, and in a matter of minutes the key could be completely full. You should stop the jobs immediately by clicking on the Jobs tab and clicking Remove All Jobs. Not only that, but you'll have to confirm you want to remove each job.

Even if I'm not running a live CD, I still find automatic rips annoying, as I may want to rip only a few songs or change my encoder before ripping. To turn off automatic ripping, go to Settings Configure KAudioCreator CD and uncheck the box next to "Automatically rip all songs upon a successful CDDB retrieval." If you choose, you can also disable automatic lookups in CDDB.

Space limitations

All ripped and encoded songs take up space. If you have a USB key, they are written to the key; otherwise, they are put in your computer's RAM. If you rip and encode too many songs, you'll quickly use up all the space on the USB key or in your RAM. To avoid running out of memory, don't rip more than two or three songs at a time (depending upon how large your USB key is), and delete your files before you rip more. (Of course, these limitations don't exist when you have Linux installed on your hard drive.)

By default, KAudioCreator will encode your music files in the Ogg Vorbis format. Since many portable music players cannot decode Ogg files, MP3 may be a better choice for you. To change KAudioCreator's default encoder, go to Settings Configure KAudioCreator Encoder, click an encoder from the list at the top, and click Apply. The LAME encoder should be used to encode MP3 files. Choosing "Leave as a wav file" tells KAudioCreator to just rip the CDs, not actually encode them. You can use these WAV files, which have the same quality as the source CD, in a CD burning program to create your own mix CDs. FLAC is a lossless encoder that produces larger files than Ogg or MP3 but smaller than WAV, and with perfect CD quality.

There are some other items of interest on this configuration screen. You can use the Encoded File Location field to enter a command that will determine the naming convention for your file and how it will be stored on your hard drive; for example, it can be stored in a folder named for the album, which is inside another folder named for the artist. The syntax for this command is not particularly complicated, but you may want to click the Wizard button to help you create it. The default should be fine for most people. You also have the option to create an album playlist when you rip the CD. This is particularly useful if you like to put all the music files for one artist in a single directory, as it allows you to play the album by selecting a single playlist file, instead of selecting the songs on an album individually.

It's now time to choose which files to rip and encode. Back in the main window, either click the Select All Tracks button, or click each track you want to rip. A check appears in the Rip column for each song you select. Once you've made your selections, click the Rip Selected Tracks button. The songs you selected are immediately queued up, and the program begins the ripping process. A window pops up to tell you that the jobs have started. Click on the Jobs tab to see the items you are ripping.

That's how the program would work if you were running Linux from the hard drive; now I'll tell you how you can use it within the limitations of the Move CD. As mentioned back in Section 4.1, if your computer has two CD drives, one is considered the primary one and the other the secondary one. KAudioCreator is configured to look for music tracks on the primary drive; if that's where your music CD is, then you're all set. If not, you can reboot, this time with Move in the other CD drive, or you can go through the same process you did with KsCD to make it see the other drive. Open KAudioCreator without a CD in the drive, and on the main screen click on the entry /dev/cdrom in the Device drop-down list. Add a 1 to the end of the entry to make the program see the second CD drive, then close the program and restart it. KAudioCreator should now be able to detect a CD in this drive, and you can rip some music.

Get Test Driving Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.