Google is teaching its self-driving cars to honk in appropriate situations. As stated in the company's report on this direction, for each case, the car should honk differently.
For example, if another car in front will quietly pass backwards, then two “soft” signals are enough. In an emergency, the Google car should give one long horn.
At first, Google engineers made the sound of the horn only inside the car and recorded whether it worked at the right time or not. Subsequently, when the algorithm began to work better, they began to buzz "out".