Facebook app will soon identify songs and TV shows just by listening to them

If you've ever wanted to tell your Facebook friends what you're listening to -- say, REM's "It's The End of The World And We Know it (And I Feel Fine)" -- without having to spell the whole thing out, well, now you can. Facebook has just announced a new option in its mobile app that can detect the song, TV show or movie that's playing in the background just by using the phone's microphone. Once it names that tune (or show), you can simply insert that info into your post with just a few taps -- no typing required.

Songs will appear as 30-second previews linked to Rdio, Spotify or Deezer depending on your preference (if you don't have a preferred service, Facebook will select one at random), while TV shows will indicate not just the name of the program but also metadata like the season number and episode title. Once you choose to turn the feature on -- and yes, it's opt-in -- the microphone will kick in whenever you're in a compose window. You'll know it's working when you see a blue audio bar animation either in the top right corner or over the smiley icon at the bottom.

Having the app listen in to your environment sounds like a rather creepy proposition, but Facebook assures us that the app is only scanning for song and TV info and no sound is ever recorded or stored on its servers. You'll also always have full control over your posts and can decide not to share what it detects. In other words, you don't have to reveal that you were just watching My Little Pony if you don't want to.

Aryeh Selekman, a product manager at Facebook, tells us that the audio recognition feature was born out of the "feelings and activities" selector tool that the company rolled out last year. "We've seen over 5 billion feelings and activities posted just in the past year," he said. "We just wanted to make it faster and easier to do."

The team at Facebook spent a little over a year dedicated to the project, eventually coming up with a unique audio recognition algorithm built entirely in-house and from scratch. A Facebook spokesperson tells us a lot of that time was spent establishing partnerships with content providers, resulting in millions of songs in its catalog and the ability to recognize programming from 160 TV stations.

When asked how the technology worked, Selekman said that it functions at a millisecond level. "As audio comes into the device, it immediately gets converted into these unique codes that we can use to identify properties that's specific to the content [...] It then looks up the code in the database and finds a match." The technique appears slightly different from Shazam, another popular audio recognition service. "For every Shazam, the application analyzes the audio and generates a tiny unique fingerprint based on the audio characteristics found within the sample," said Charles Henrich, Shazam's Executive Vice President of Engineering. "It then uses this fingerprint to search against our database of tens of millions of audio tracks until it finds a match."

I had a chance to preview the new song and TV show identification feature a few days ago, and I was overall quite impressed by its speed and accuracy -- bearing in mind that I was testing it in a quiet conference room, which is very much an ideal setting. Identifying songs took mere seconds and naming TV shows didn't take much longer. Indeed, the app only needed the first ten or so seconds of a Game of Thrones clip before nailing down that it was from the sixth episode of the fourth season. The audio recognition even works for live TV -- it figured out we were watching CNN within a few seconds. Though we didn't have a chance to test it, Facebook tells us it's able to recognize live sporting events as well.

"This lets you add a soundtrack to your posts," said Selekman, stating that you can use it to bundle photos with songs you heard at an event, like during a wedding or a concert. TV show recognition can also help foster conversation about a certain episode, and maybe help you avoid spoilers. Of course, we had to ask if Facebook's thinking of using the feature for targeted ads, and the company told us that while that's certainly a possibility down the road, it probably won't happen just yet as it continues to test the service. Facebook plans to roll out the update to Android and iOS over the coming weeks, so keep a look out for it. In the meantime, check out a brief preview of it below.