When predators approach, some birds sound the alarm to let these unwelcome animals know they've been spotted.

When a bird is in danger, who does it call? The answer depends on the bird and the location of any potential predators, according to a study published in the journal Proceedings of the Royal Society B.

For some species, the alarm call goes out to neighboring birds, or conspecifics, to alert them of a nearby predator and possibly incite a defensive mob attack against it.

Birds can also shift the acoustic direction of their alarm call toward the foe as a warning that it has been spotted, especially when facing to the front or side of it.

"There are no detailed reports in the wild of how these birds respond to predators," said Jessica Yorzinski, a graduate researcher at the University of California, Davis, who conducted the study. "If they're calling from inside of a bush where it's denser, it might benefit them to have a different directionality than a bird that's out in the open."

Yorzinski and Assistant Professor Gail Patricelli analyzed more than 2,900 anti-predator calls from 10 species of perching birds, or passerines, to determine how they direct the vocalizations.

Each bird was placed in an outdoor cage outfitted with eight omnidirectional microphones to record the audio of bird calls. Three closed-circuit video cameras captured the birds' body and head orientation as well.

The researchers then introduced a stuffed great horned owl into the environment to elicit the anti-predatory chirps.

The analysis confirmed the prediction that birds send out alarm calls with lower acoustic directionality to warn neighbors and calls with higher directionality to catch the predator's attention.

But Yorzinski told Discovery News that the most surprising finding was that some species, including house finches and yellow-rumped warblers, will direct their calls toward the predator when turned toward the side, as though talking out of the corners of their mouths.

"They might have to be oriented to the side of the predator so they can see them since their eyes are located on the sides of their heads," Yorzinski explained.

Although the study didn't explain how the birds execute these ventriloquist calls, it will likely instigate further research into these complex sound production mechanisms in birds, says Sandra Vehrencamp, a professor at the Cornell Lab of Ornithology.

"(The study) indicates that even normal bird vocalizations can be beamed to the side or behind and are under voluntary control by the sender," Vehrencamp said. "Previous work on the sage grouse suggested that this might only be achieved with a complex vocal structure such as the sacs on the male grouse's chest."

Cristen Conger is a writer for HowStuffWorks.com.