Some folks just can’t help being loud in bed, but noisy liaisons can lead to a swift death… at least for a housefly. In a German cowshed, Natterer’s bats eavesdrop on mating flies, homing in on their distinctive sexual buzzes.

Based on some old papers, Stefan Greif form the Max Planck Institute for Ornithology knew that Natterer’s bats shelter in cowsheds and sometimes feed on the flies within. What he didn’t know was how the bats catch insects that they shouldn’t be able to find. They hunt with sonar, releasing high-pitched squeaks and visualising the world in the returning echoes. Normally, the echoes rebounding from the flies would be masked by those bouncing off the rough, textured surface of the shed’s ceiling. The flies should be invisible.

And they mostly are. Greif filmed thousands of flies walking on the shed’s ceiling, and not a single one of them was ever targeted by a bat. That changed as soon as they started having sex. Greif found that a quarter of mating flies are attacked by bats. Just over half of the attacks were successful and in almost all of these, the bat swallowed both partners.

It’s not their larger silhouette that gives the mating flies away. When Greif stuck pairs of dead flies onto the shed’s ceiling, in a macabre sexual diorama, the bats never attacked. Instead, the male fly dooms both himself and his partner by being too noisy. As he mates, his wings flutter and release a stream of clicks. Our ears can pick out the low-pitched parts of the buzz, but to Natterer’s bats, the high-pitched portions must sound like klaxons. Greif demonstrated the allure of these sounds by playing recordings of them. When he did, the bats would attack the speakers.

The cowshed provided a rare opportunity to test the hunting tactics of the Natterer’s bats, but Greif suspects that they do the same thing in more natural settings like forests and meadows. You might expect that evolution would lead the flies towards quieter sex, and that’s something Greif wants to analyse next.

Scientists have long suspected that mating animals can make themselves more conspicuous to predators, but examples of such risky business are few and far between. One was discovered in 2010: when a male water strider tries to mount a female, he will sometimes strum the water to summon predators if she doesn’t comply. But in that case, the female (who is stuck on the bottom of the pair) is the only one at risk. For the flies in the shed, it’s unlikely that the male is playing a similar extortion game, because he’s as likely to be eaten by a bat as his partner.