HOW IT WORKS
Music recognition in Shazam
YOU WILL LEARN How music recognition software works on your devices
In recent years, Apple has quietly bought some of our favourite apps. It owns the weather app Dark Sky and is in the process of integrating it with its own weather widgets, it bought the reading app Texture to create Apple News, and it also acquired the music recognition app Shazam.
We’ve been using Shazam for years to recognise songs, and because we’re bad people we’ve occasionally used it on our Apple Watch during too-difficult pub quizzes (ahem, only kidding). But we mainly use it as a force for good, to identify and save the great music we didn’t know about. Our Apple Music and Spotify libraries would be much poorer without it.
Shazam works in a very similar way to our brains. You only need to hear a few seconds of The Beatles’ Help!, Prince’s Kiss, Metallica’s Enter Sandman or Cardi B’s WAP to know what the song is because you recognise its unique audio. Shazam does the same thing, but in a much more detailed and effective way – and it can do it by listening to any part of the song.
The science bit
Shazam is essentially Touch ID for tunes: it can recognise a song’s fingerprint and compare it to the songs in its giant database. If you’re offline, it’ll store the fingerprint until your device gets an internet connection.
To create a fingerprint, Shazam needs to capture some audio. It uses the microphone in your Apple Watch, iPhone, iPad or Mac to listen to the song that’s playing, and after 10 seconds it has enough audio to calculate an audio fingerprint for it. That fingerprint is a spectrogram, which is sometimes called a sonograph or a voiceprint: it’s effectively a very detailed graph that says ‘at this time, this frequency was played at this volume’. Audio spectrograms are also used in voice recognition and language processing systems.
Even very similar sounding songs have very different audio fingerprints, and if you have a database of enough fingerprints, you can match even the most obscure track. It certainly helps if, like Shazam, you’ve been fingerprinting audio since 2002: it’s been around since before the iPhone, never mind iPhone apps. In its first incarnation, you had to call a number on your phone in order to recognise the music and you had to pay for the privilege: in 2006, Shazaming a song cost 60p a call or £4.50 a month for unlimited use.
Shazam is Touch ID for tunes: it can analyse and recognise a song’s audio fingerprint
How to use Shazam
Since it acquired Shazam, Apple has kept the stand-alone app going – but it’s also integrated the tech into Control Centre on iOS and iPadOS. You can add it by going into Settings > Control Centre and turning and clicking the ‘+’ next to Music Recognition.
If you have a HomePod or HomePod mini, you can ask Siri to Shazam a song, and on iOS devices you can say to Siri, “what song is playing?” There’s also a Shazam It action you can add to your Shortcuts. On the Mac, you can download Shazam for Mac from the Mac App Store to add music recognition to your Mac’s menu bar.
One of our favourite features is Auto Shazam. If you touch and hold the Shazam button or double-click it on a Mac, it turns on Auto Shazam. That enables you to go and do something else while Shazam continues to listen and match the audio that’s playing around you. It’ll then add links to those songs in the My Music section with the Auto-Shazams clearly labelled and grouped by date. You can turn this feature off again with a tap or a click.
When the hardware can’t hear
The biggest problem with audio fingerprints is the same as with actual fingerprints: you need to get a readable print, or in this case a listenable one. If there’s too much ambient noise or competing audio it messes with the spectrogram and makes it hard if not impossible to get a match.
You can thank your iPhone and other mobile devices for the speed and accuracy of tune recognition: the huge advances in smartphone and tablet audio tech have really benefited services such as Shazam. Noise-cancelling microphones, better audio software and battle-tested algorithms deliver cleaner audio that’s much easier to analyse.
Creating and matching the fingerprint is the hard bit. After that, the app’s job is much easier: it simply pulls up the matching song data and any related links (such as Apple Music or Spotify links).
Apple Music
Shazam has linked to Apple
Music tracks for a long time but the two services are getting ever closer. If you’re an Apple Music subscriber, any songs you Shazam are automatically added to a playlist called My Shazam Tracks in your Music app. There’s also a Buy on iTunes link, but if you’re already paying for Apple Music you don’t need it.
The integration is already impressive but you might want to keep the Shazam app: it has some useful features in its own right, such as synchronised lyrics that follow the audio. That can help you win arguments about what the lyrics to a song really are, and it doubles as a cool instant karaoke feature too. The Shazam app also has some great music discovery features and its own playlist organisation with Apple Music and Spotify playlist integration. Carrie Marshall