One 53MB file stored on the Pixel 2 holds details of all 17,300 songs so Google’s servers aren’t required for the most popular detections.
The smartphones we all use every day are setup to be in constant contact with servers in the cloud so our apps continue to function. But Google’s Pixel 2 smartphones include a new feature for song recognition that functions offline for thousands of music tracks.
The feature every Pixel 2 will include for song recognition is called Now Playing. It will automatically detect the music it hears playing and display details of what each song is on the lock screen of your Pixel 2 or Pixel 2 XL. You would expect Now Playing to require a server connection to figure out what a song is, but it will work pretty well offline and can detect over 10,000 tunes without an Internet connection according to Google.
The folks over at xdadevelopers wondered which songs and exactly how many Now Playing is capable of detecting offline, so they started digging. They discovered a file called matcher.leveldb located in the system/etc/ambient folder which is only 53MB in size. The small size belies the contents, though. It contains details of 17,300 songs for Now Playing to call upon without need of a server.
It’s not clear why there are 17,300 tracks specifically, but each entry in the database file includes the song name and artist. Google must use some method to pick which songs make it into this offline database based on the popularity of individual tracks at any given time.
This means the database will have to be updated regularly as the popular music being played changes. It also makes sense that Google would vary the offline database contents based on your location in the world. Music tastes differ greatly per region after all.