Music on the Move

by Matt Ernst <erns0637@pacificu.edu>

BS, Computer Science, Pacific University

INDEX:

.01 Compressed digital audio
.02 Extracting music
.03 Compressing music
.04 Integrating metadata
.05 Making it mobile

Summer is coming to the northern hemisphere. Along with sunscreen, air conditioning, and shark repellent, a portable music collection is essential to an enjoyable summer. In the 20th century, people might have carried their music around on audio compact discs, cassette tapes, magnetized wire, or player piano reels. But the 21st century offers better choices.

Thanks to audio compression tools, relatively inexpensive CD creation tools, and portable players that handle compressed audio, it is possible to carry around ten albums on a single CD. In addition, this super-album need not be protected from damage or theft the way 10 CDs would. It is relatively easy to create a library of music - containing ordinary albums or a custom selection of songs - that can go anywhere you can, and that won't break your heart if the disc breaks in two.
The fundamental steps are:

  • Extract music
  • Compress music
  • Mate compressed music with metadata
  • Store music for mobile use

.01 Compressed digital audio (return to index)

Music contains a lot of information. One minute of CD-quality audio occupies about 10 megabytes of space. This limits CD play time to no more than 74 minutes for standard CDs (80 minutes for extended). However, by exploiting the regularity of audio signals and the limitations of human hearing, it is possible to store a good approximation of a recording in far less space than an exact duplicate would require. CD audio is itself a sampled and manipulated approximation of the "true" original as found in a recording session, so compressed digital audio is actually an approximation of an approximation, but in practice the approximations are so close that other factors (ambient noise, quality of sound reproduction equipment) usually hurt the listening experience before the space-saving approximations.

The de facto standard for compressed digital audio - at least on most personal computers and consumer devices - is Moving Picture Experts Group audio layer 3, a.k.a MPEG audio layer 3 or MP3. Development of MP3 dates back to the late 1980s, but it is only since the spread of Internet access and relatively powerful personal computers that MP3 has become (in)famous as a tool for storing and moving music. Tools for MP3 creation and playback are very mature, widely available, and often free.

Much of the space savings achieved by MP3 compression is centered around a psychoacoustic model - a particular mathematical formulation of what sounds in a complex recording are essentially inaudible to a human listener. People do vary in what they can hear, but with the highest quality compression, even the most discerning listener will have a hard time distinguishing an MP3 from its CD master. A partial exception to this rule rises if you use a dynamic equalizer on the music to adjust the intensity of different frequencies as it's played back. Now you're listening to something different from what the psychoacoustic model tried to code for, and you may be able to hear unusual glitches in the music, especially if you use the equalizer aggressively. Also keep in mind that there is always a tradeoff between file size and quality when using a given MP3 encoder.

.02 Extracting music (return to index)

To make MP3 files, you first need uncompressed audio to start from. This usually means extracting information from an audio CD on a personal computer. CDEx for Windows, iTunes for the Mac, or grip for Linux will provide you with the needed ability to extract audio information directly from a music CD. These tools can convert native CD audio to WAV or AIFF sound samples, which are more common than raw CD audio and easier to manipulate on a typical personal computer. If your source material is not on CD, like a phonograph record or cassette tape, the process is more complicated. You'll need to connect the line-out of the playback device to the line-in on your sound card, record the album or tracks to a file in an audio recording/editing program, and convert the resulting files to MP3. These files are likely to sound noticeably worse than ones taken directly from CD, so CD is always the source of choice for quality and convenience.

.03 Compressing music (return to index)

Of the many free and commercial MP3 encoders available, LAME is among the very best. This free program has been under development for five years and offers excellent, high-quality compression with fine control over the encoding process. If you are running Linux or another Unix-like system, the command line tool may suit you perfectly well. Otherwise, under Windows CDEx includes LAME as its encoder, and iTunes can use LAME as a plugin if you aren't satisfied with its default encoder. LAME can create very high quality MP3 files that are indistinguishable from CD even on high end audio equipment. You do pay a space penalty for such quality, however. Looser settings will provide files that are smaller and still sound fine, especially if you're encoding pop/rock music. Keep in mind the circumstances under which you're going to experience the music: if you are jogging, driving a car, or listening on inexpensive headphones or speakers, surrounding noise and the shortcomings of the playback system will mask any difference between ordinary and high-quality encodings. However, if you think you may ever want to listen to your music on good speakers in an otherwise quiet environment, use a few extra bytes and go with the high quality encoding. The difference can be striking, especially with sharp percussion.

.04 Integrating metadata (return to index)

Metadata - additional data about your audio data, stored in the same file - is a valuable aid in organizing (or even recognizing) your music collection once it grows larger than a few dozen songs. "ID3" tags record information like album title, artist, genre, and year. It's tedious to enter all of this information by hand, but you don't have to do that. The audio extraction software we've previously mentioned can examine the audio it extracts to obtain a "signature" and then query cddb or freedb to automatically retrieve metadata, which can then be added by the application in the encoding phase. This is another case where an analog source will hurt you, as you'll have to manually add the metadata yourself, or do without it altogether. It's highly recommended that your files have this information added, because trying to remember what song "03 - 148" represents isn't much fun at all.

.05 Making it mobile (return to index)

Once you've accumulated a selection of albums or songs - that is, have extracted them, encoded them, and added any metadata you need - it's time to take them with you. Although there are a few very nice devices like the Creative Nomad or Apple iPod that use small hard drives to store songs, more affordable (and almost as good) are the various CD MP3 players. These devices read ordinary music CDs as well as discs (including CD-R and CD-RW format) containing MP3 files. They behave like a portable CD player on steroids. More expensive devices offer extra niceties like a larger display or advanced file management capabilities, but even bargain models should handle the basic task of scanning a disc and playing its MP3 files. One especially nice feature of most models is that they can buffer a minute or more of audio when playing MP3 as compared to the few seconds usually available in ordinary portable CD players. Since MP3 audio is so much more compact than CD audio for a given amount of play time, a modest buffer can make the device virtually skip-proof even under extreme conditions.

Once you've used a CD recorder to store your nicely encoded MP3 files on writable or rewritable media, you can take them virtually anywhere. Since blank disks are so inexpensive, you can afford to leave them in your car (in the glove compartment, on the floor) or other hostile environments without worrying about cracked jewel cases or scratched/stolen disks. If wear and tear do eventually render a disk worthless, it's easy to replace. Also, since you can pack about 10 hours of music onto a disc with high quality compression, you won't have as many CDs lying around, needing to be swapped as each album ends or waiting to die as they float around the vehicle/room. Use of MP3 and recordable discs can make your original music collection virtually immortal, since it never needs to be in harm's way.