How does the music-identifying app Shazam work its magic?

Innovation, the Internet, gadgets, and more.
Oct. 19 2009 5:14 PM

That Tune, Named

How does the music-identifying app Shazam work its magic?

Shazam application logo for the iPhone.

Shazam is the closest a cell phone can come to magic. Say you're in a restaurant, a song comes on, and you can't quite place the tune. In the past, your options were limited; you could try asking your spouse or the waiter for a clue, but that approach risked revealing your ignorance. (That's " Sex Machine," dumb ass.) Shazam—which launched in the United Kingdom in 2002 as a call-in service and became widely known in the United States last year when it hit the iPhone—solves the dilemma in a few clicks. Press a button on your phone, and in seconds you'll get the artist and song title. Other than playing video games, it's the most useful thing you can do on your phone.

Last week, Shazam announced that more than 50 million people worldwide have used the service—up from 35 million at the start of the year. The company also said that it's received an undisclosed investment from the fabled Silicon Valley venture-capital firm KPCB. Shazam's success seems justified—it's the one app you can show to iPhone skeptics to get them to reconsider their position (though Shazam is also available on Android, BlackBerry, Windows Mobile, and pretty much any other phone). Yet for all the acclaim it garners, Shazam's inner workings are pretty mysterious. How does it actually ID your song? How does the company make money? (Here's one hint: iPhone users should expect to see a pay version soon.) And what are the long-term prospects for a firm whose sole purpose is satisfying an acute, very occasional need?

Advertisement

First, a short explanation of how Shazam works. The company has a library of more than 8 million songs, and it has devised a technique to break down each track into a simple numeric signature—a code that is unique to each track. "The main thing here is creating a 'fingerprint' of each performance," says Andrew Fisher, Shazam's CEO. When you hold your phone up to a song you'd like to ID, Shazam turns your clip into a signature using the same method. Then it's just a matter of pattern-matching—Shazam searches its library for the code it created from your clip; when it finds that bit, it knows it's found your song.

OK, but how does Shazam make these fingerprints? As Avery Wang, Shazam's chief scientist and one of its co-founders, explained to Scientific American in 2003, the company's approach was long considered computationally impractical—there was thought to be too much information in a song to compile a simple signature. But as he wrestled with the problem, Wang had a brilliant idea: What if he ignored nearly everything in a song and focused instead on just a few relatively "intense" moments? Thus Shazam creates a spectrogram for each song in its database—a graph that plots three dimensions of music: frequency vs. amplitude vs. time. The algorithm then picks out just those points that represent the peaks of the graph—notes that contain "higher energy content" than all the other notes around it, as Wang explained in an academic paper he published to describe how Shazam works (PDF). In practice, this seems to work out to about three data points per second per song.

TODAY IN SLATE

Politics

The Irritating Confidante

John Dickerson on Ben Bradlee’s fascinating relationship with John F. Kennedy.

My Father Invented Social Networking at a Girls’ Reform School in the 1930s

Renée Zellweger’s New Face Is Too Real

Sleater-Kinney Was Once America’s Best Rock Band

Can it be again?

The All The President’s Men Scene That Captured Ben Bradlee

Medical Examiner

Is It Better to Be a Hero Like Batman?

Or an altruist like Bruce Wayne?

Technology

Driving in Circles

The autonomous Google car may never actually happen.

The World’s Human Rights Violators Are Signatories to the World’s Human Rights Treaties

How Punctual Are Germans?

  News & Politics
Politics
Oct. 22 2014 12:44 AM We Need More Ben Bradlees His relationship with John F. Kennedy shows what’s missing from today’s Washington journalism.
  Business
Moneybox
Oct. 21 2014 5:57 PM Soda and Fries Have Lost Their Charm for Both Consumers and Investors
  Life
Outward
Oct. 22 2014 9:00 AM Wailing Against the Pansies: Homophobia in Whiplash
  Double X
The XX Factor
Oct. 21 2014 3:03 PM Renée Zellweger’s New Face Is Too Real
  Slate Plus
Working
Oct. 22 2014 6:00 AM Why It’s OK to Ask People What They Do David Plotz talks to two junior staffers about the lessons of Working.
  Arts
Brow Beat
Oct. 21 2014 9:42 PM The All The President’s Men Scene That Perfectly Captured Ben Bradlee’s Genius
  Technology
Future Tense
Oct. 22 2014 8:43 AM Thunderstruck: Rock Out With Mother Nature’s Evil Side
  Health & Science
Bad Astronomy
Oct. 22 2014 7:30 AM An Illusion That Makes Me Happy and Sad
  Sports
Sports Nut
Oct. 20 2014 5:09 PM Keepaway, on Three. Ready—Break! On his record-breaking touchdown pass, Peyton Manning couldn’t even leave the celebration to chance.