Search code examples
audiosound-recognition

Software: How does software recognize a song?


I was playing with my phone and there is this app on it that when u use it to record 10 seconds of a song, it tells you the title and author of that song. Now as a software engineer I can't help but wonder, How does this work?


Solution

  • Well, actually Shazam has written a paper explaining the inner workings of the algorithm, you can find it at this address (pdf).

    Basically they have a huge database of all the songs that the algorithm can recognize and they create a kind of "hashtag" of the music using its spectrogram. Then, when you record a part of the song and send it to them, they pass it through the same algorithm and try to match it with the hashtags that are stored in the database.

    Of course it's a lot more complicated than that since they have to manage the recording noise and stuff like that, but it's the basic idea.