oss

How does a CD drive recognize an album before the first note?

5 sources 4 primary sources November 26, 2026

Loading reads and saves…
Text

Slide an audio CD into a computer, open MusicBrainz Picard and choose Lookup CD. A list of albums can appear before you have played a note. The drive supplies a table of contents, the open-source library libdiscid turns a set of positions into a lookup key, and MusicBrainz supplies the names. You can see exactly where each part of that arrangement earns its keep by moving the start of a single track.[1][2][3]

Thirteen milliseconds at track two

Take the six-track disc in MusicBrainz’s worked example. Its first track starts at frame 150 and its second at frame 15,363. There are 75 CD frames to a second, so the distance between those starts is 15,213 frames, or 3 minutes and 22.84 seconds. The drive can report both addresses without making any judgment about where the musicians stopped playing. A stretch of applause up to the second address belongs to track one when a listener uses the skip button.[2]

Now imagine preparing a second pressing of that concert. Keep the audio continuous and move the marker for track two one frame later into the applause. Both editions could still print “3:23” for the opening track. Even a listener who played the two discs from beginning to end would hear the same concert. Someone pressing skip on the second disc would arrive about thirteen milliseconds later.[2]

Run the published calculation on the original six offsets and the result is 49HHV7Eb8UKF3aQiNmu1GR8vKTY-. Change 15,363 to 15,364, hold the other five starts and the end of the disc fixed, and the result is oKKOPrtbr1.cfj46H3rzRSPaUmM-. The two strings look equally unfamiliar because the algorithm hashes the whole table. A client cannot tell how far a boundary moved by comparing the letters.[2]

Flatbed scan of a Sony compact disc showing its circular recording surface and clear center hub.
Arun Kulshreshtha scanned this Sony disc in 2007. The track addresses used in a lookup are encoded on the disc itself.[2][5]

Where the last track ends

For the first five tracks, the next start gives the software a convenient end point. Track six needs one more address. On the example disc that address is 95,462, the start of the lead-out. If a mastering engineer extended the final applause by a second, every song could start at its old address and the lookup key would still change. The lead-out moves by 75 frames and it, too, goes into the hash.[2]

This is one reason to let libdiscid read the drive. Consider an enhanced CD that also carries a video for a computer to play. The drive can report a data track after the music, separated from the audio session by a gap. Treating the beginning of that data track as the end of the concert would count the gap as playing time. MusicBrainz documents a real eight-track example in which only seven tracks belong in the audio calculation. The library handles the drive-specific reading and exposes the resulting Disc ID to the application.[1][2]

Why Picard can offer two answers

Try the opposite thought experiment. Replace the concert audio with an entirely different performance of exactly the same duration, preserving every track address and the lead-out. The input to the hash is now identical, down to the last digit. Both discs yield the same key. A more everyday case needs no change of performance at all. A label can issue the same disc in two countries with different packaging. MusicBrainz allows a Disc ID to be attached to multiple releases, and different pressings of one release can carry different IDs.[4]

That explains a small courtesy in Picard’s interface. When a lookup returns two plausible editions, the program gives the collector a choice. Turn the jewel case over and compare the barcode, then check the catalog number on the spine against the candidates. The disc drive has already answered a precise question about where the tracks begin. The edition printed on the sleeve is a piece of evidence the person holding it can supply.[3][4]

Sources

  1. MusicBrainz, libdiscid library and drive interface
  2. MusicBrainz, Disc ID Calculation, including the six-track and multisession worked examples
  3. MusicBrainz Picard documentation, When the CD is available
  4. MusicBrainz, Disc ID and its relationship to releases
  5. Arun Kulshreshtha, Compact Disc, 2007 archival scan, Wikimedia Commons, CC BY-SA 2.5
Previous How far should a paddle move on an Arduboy? Next When one foldout widens every page of a scanned book

Recommended In oss

Matched by subject and format