According to some folks, smart speakers such as Google Home and Amazon Echo simply make us lazy while needlessly adding electronic complexity to our lives. Thanks to new research, however, the things may someday prevent people from dying of cardiac arrest while sleeping.

When someone is experiencing cardiac arrest – in other words, when their heart suddenly stops beating – they either cease breathing, or they start gasping for air. The latter is known as agonal breathing.

In some cases, their lives can be saved if CPR (cardiopulmonary resuscitation) is administered by a bystander within a few minutes. If they're alone or with another deeply-sleeping person in their bedroom, though, it's unlikely that anyone else will hear what's happening.

Concerned by this situation, scientists from the University of Washington started by collecting 236 2.5-second audio clips of cardiac arrest patients' agonal breathing. These were drawn from 162 actual 911 calls made to Seattle's Emergency Medical Services between 2009 and 2017. The people who made these calls held their phone to the patient's mouth, so that dispatchers could hear how they were breathing.

Utilizing machine learning techniques, the researchers created additional audio clips, boosting the dataset to a total of 7,316. They also created a 7,305-clip dataset of sounds regularly made by people while sleeping, such as snoring.

All of these sounds were subsequently analyzed by machine learning algorithms. The result was a program that could correctly identify agonal breathing 97 percent of the time, when "listening" via a smart device such as an Amazon Echo that was placed up to six meters (20 ft) away from a speaker emitting the audio.

It is now hoped that once developed further, the tool could take the form of an app that would run on smart devices (possibly including smartphones) in at-risk individuals' bedrooms throughout the night.

"We envision a contactless system that works by continuously and passively monitoring the bedroom for an agonal breathing event, and alerts anyone nearby to come provide CPR," says Assoc. Prof. Shyam Gollakota, co-corresponding author of a paper on the research. "And then if there's no response, the device can automatically call 911."

The paper was published this week in the journal npj Digital Medicine.