Google added this optional feature to pixel lock screens a few years back. You can 'heart' songs and it adds them you your playlist. It looks like my phone ID's about 300 songs a month!
I loved that feature of my old Pixel. Even in the middle of Germany, with no cell reception whatsoever, I'd surprise people by looking at the always-on-display to see what song was playing somewhere.
Yeah it's pretty cool that it runs off-line. I wonder how large the local database is? They did add a second togglable option that lets you chose an online search if the song not recognized.