Chapter 9. Project 6: Audio CD Catalog

Although in this day and age of MP3, AAC, and OGG the audio CD feels a bit retro, it’s still one of the most popular media formats of all time. As any audio purveyor will tell you, a solid collection of audio CDs can represent considerable investment in time, energy, and emotion.

In this chapter, you will use two web service providers to build an online catalog of audio CDs (and as a by-product, calculate the list value of the collection).

CDDB

Audio CDs, surprisingly, contain no information about the music on the CD. A medium that affords over 600 MB of disk space, oddly, can’t find the room to store even a small bit of text describing the artist, the names of the tracks, copyright information—nothing. A few modern CDs are specially crafted to make them hard to rip or contain extra bonus media, but you won’t find anything about the audio contents.

To resolve this problem, most popular audio CD conversion applications calculate a fingerprint for the audio CD, connecting via the Internet to retrieve the audio CD artist, album, and track listing information from a server. The server maintains a set of fingerprints and information in a database. Unfortunately, computing the audio CD fingerprint requires lower-level access to the CD drive than is afforded by Java, so a native extension is required to compute the fingerprint.

The original system for storing audio CD track and listing information was simply called CDDB, short for CD database. Eventually, ...

Get Real World Web Services 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.