Shazam is one of my favorite apps. It eliminated the days of having to Google scraps of song lyrics or try (and fail) to remember them if I heard a song in a movie trailer or on the radio.
If you use Shazam's Android app, you'll see an alert at the bottom of the main screen. It'll let you know you can now Shazam music even if you have your headphones in. A little headphones icon appears next to "Tap to Shazam" when you plug your headphones into your phone (and it disappears when you pull them out).
The feature works best in tandem with Pop-Up Shazam, which you can toggle on in the app settings. In my experience on the Pixel 3, I had to tap Try Now for the Shazam icon to be useable. Tapping Try Now launches YouTube. Now if you're watching a movie trailer on YouTube or IMDB, for example, you can leave your headphones in and tap the Pop-Up Shazam icon. The app can also pick up songs that are playing around you (i.e., not in your headphones).
It's not a huge change, but it saves you a few steps of pulling out the headphones and using the phone's speakers if you want to discover a new song. It's not clear when (or if) the feature will come to the iOS app. Apple, which owns Shazam, didn't immediately respond to a request for comment.