Why not just emit the sound when going below a certain speed AND ONLY IF there are pedestrians closer than a certain distance? That would be more expensive for sure but doesn't cause unnecessary sound pollution.
Sure, easy thresholding on speedometer data. Gimme a few hours.
> ... and check if there are pedestrians closer than a certain distance
I'll need a research team and five years. [1]