Through its software, Alphonso can follow the ads that people see in friends’ homes and elsewhere. The company has also worked with movie studios to figure out theater-viewing habits, Mr. Chordia, Alphonso’s chief executive, said. Smartphone apps that are running Alphonso’s software, even if they are not actively in use, can detect movies based on film snippets provided by the studios ahead of time.

“A lot of the folks will go and turn off their phone, but a small portion of people don’t and put it in their pocket,” Mr. Chordia said. “In those cases, we are able to pick up in a small sample who is watching the show or the movie.” Mr. Chordia said that Alphonso has a deal with the music-listening app Shazam, which has microphone access on many phones. Alphonso is able to provide the snippets it picks up to Shazam, he said, which can use its own content-recognition technology to identify users and then sell that information to Alphonso.

Shazam, which Apple recently agreed to buy, declined to comment about Alphonso.

Founded in 2013, Alphonso initially focused on working with apps to capitalize on ads through so-called second-screen viewing, as people increasingly turned their attention to smartphones and tablets during TV breaks. Now, the company has broadened its focus to gathering troves of viewing data from companies like TiVo and directly from TVs and streaming devices through deals with manufacturers.

The disparate viewing information is tied to IP addresses, which can be matched to characteristics like age, gender, income and more through big data brokers like Experian without using personally identifiable information like names and addresses.

Still, the connection between microphones and ads is a sticky one. Americans are both inviting internet-connected speakers from Amazon and Google into their homes in droves while expressing anxiety that companies are secretly listening to them and then using that information in unsettling ways, like eerily relevant ads. (Facebook has tried, and failed, to quash that theory many times.)

“We have to be really careful as we have more devices capturing more information in living rooms and bedrooms and on the street and in other people’s homes that the public is not blindsided and surprised by things,” said Dave Morgan, the founder and chief executive of Simulmedia, which works with advertisers on targeted TV ads. “It’s not what’s legal. It is what’s not creepy.”

Alphonso’s apps and its relationship with Shazam show that there can be a connection between what our phones may hear and the ads that appear on a website or social media feed in the next few hours.

