Categories
shazam

How Does Shazam Work?

how does Shazam work

How Does Shazam Work? When one of the interviewers pops the question during a global mobile community meeting held in Tokyo last week, a brawl were created among developers. How does Shazam recognize a song from a tenth of a second to less than a minute? Apparently, this is something amazing and unbelievable although we are living in technological era. Developers scratched their head in order to find out Shazam’s algorithm. Let’s spend five minute to read this article if you are curious to find out the secret behind this awesome app.

What is Shazam?

Imagine that you are now sitting in a car with a few friends on your way to a party. The car radio is playing a nice song and one of your friends is asking for the name of the song. No one knows the song name and you usually forget the rhythm of the song afterwards. Back in the old days, the chances for us to recognize a song are very low. Just when you thought you knew the name of a song, you could be wrong! But today, this UK-founded Shazam could definitely help you. Shazam is a music-related app that is capable of identifying any kind of music. This app takes a few clicks and a few seconds to recognize a song that you put through the microphone of your mobile phone or tablets. It works awesome on the iPhone, iPad, and iPod Touch and it brings on a heat wave in the iOS market since 2008. After rolling in the market for more than 10 years, Shazam app is frequently rated as the most valuable app of the decade.If you have not used Shazam before or it is installed in your device but never been used, you may want to juggle around with that.

How Does Shazam Work?

If Google is a collection of all websites in the world, Shazam is a library of all songs available on earth. According to a source from the internet, Shazam’s database has included more than 9 million songs. Each song is converted to a unique numeric code (fingerprint) and stored in a distinctive way using Shazam’s algorithm. Every time a song is played through the microphone of a device, Shazam converts this song into a numeric code (fingerprint) using the same algorithm and match the code from its database. It looks like it is a find and match algorithm, isn’t that sounds easy to understand? Wait a minute, this multi-million app has more for us to explore.

So, what is the algorithm that converts each of every song to a unique numeric code and how does it convert a song that so that no codes are the same. It sounds very hard to identify a song because there are too many different beats. According to Avery Li-Chun Wang’s research, one of the developers, the algorithm uses Spectrogram to store every song in its database. Spectrogram is a time versus frequency versus intensity graph. Two different songs may have a few similar frequencies but the intensity of these frequencies will not be the same and they won’t be appearing at the same specific time. If they do, they are the same song or same music.

Shazam spectrogram

The graph above is an example of a Spectrogram (Fig. 1A) and how the algorithm transfers it to a simpler Spectrogram (Fig. 1B), and then store it according to anchor point and target zone (Fig. 1C) using hash (Fig. 1D). This is an intelligent way of storing a data as it provides an efficient way for the algorithm to search for a match.

scatterplot

The graph above shows how a fingerprinted audio file is being used to match against other fingerprints from the database. Top graph shows an unmatched and bottom graph shows a match. If a music being played has noisy sound behind at the time a user hit the “tag now” button to run Shazam, an error message will appear because there is no match found. Otherwise, the song name, artist, and lyrics will be returned.

The future for Shazam

Shazam is one of the strongest leaders in its industry although it has some other competitors such as Soundhound. So far, Shazam works amazingly in many iOS devices and other Android devices. We understand that it still has some limitations because of the databases size. Will it be perfect if Shazam is able to identify any sound including animal’s voice?