The blare of a horn is a common—and sometimes not-so-welcome—sound found in big cities. Still, the noise can serve a purpose when it’s used correctly. A beep that says ‘stop texting the light is green,’ might be one such warning.
Engineers with Google’s self-driving car project have not only taught its autonomous prototypes when it’s appropriate to honk, the cars use a different honks and beeps depending on the circumstance, according to Google’s monthly self-driving car report, which was released late Wednesday.
The engineers at the Google (GOOG) self-driving car project, which is housed under Google X, designed its software to recognize when honking may be useful. For instance, laying on the horn comes in handy if another driver begins to swerve into the lane of the self-driving car.
Get Data Sheet, Fortune’s technology newsletter.
At first, engineers used software to teach the vehicle to distinguish between potentially tricky situations when to use a horn and false positives. The horn initially was only played inside the car, Google says. Test drivers then determined whether the beep was appropriate to help engineers further refine the software.
As a result, the self-driving cars now know the fine difference between a car facing the wrong way during a three-point turn, and one that’s about to drive down the wrong side of the road. And they broadcast the horn sound to the outside world because honking algorithms have improved, Google says.
Google has even taught its vehicles to use different types of beeps depending on the situation. After all, not all horn sounds communicate the same idea or intent.
Google Has Shared Its Self-Driving Tech With an Automaker:
For instance, Google’s car will belt you two short pips when another vehicle is slowly reversing towards the Google car. This is the friendliest of beeps. Or it may lean into one loud sustained honk in a situation that requires more urgency.
Google has also added a hum to its prototype cars to mimic the sound characteristics of traditional cars, such as increasing the pitch when it accelerates, and decreasing the pitch when it decelerates. The noise was designed to be familiar so pedestrians and cyclists around know what to expect, the company says.
And how does that noise sound? Google engineers experimented with various tones as they honed in on the ideal alert. They looked to other vehicles, modes of transport, consumer electronics products, and even ambient art sculptures, the company says. They even experimented with the sound of an orca, their search went so deep.