These guys make acoustic sensors for police support in major US cities:

https://www.shotspotter.com/

They say a mile is about right for a handgun. Two major caveats.

The first is that with range and wave variables you might have a very hard time telling it actually was a gunshot at that distance as opposed to a different sound closer.

The second is that your own surroundings matter a great deal, both in the raw decibel sense of when is the sound actually capable of overcoming sounds around you, and of the mental ability to pick out a noise as a gunshot. It helps that for modern firearms humans tend to fire in consistent patterns of shots which allows an initial identification of the noise, categorizing as “yes, gunshots”, followed by extra mental effort and focus on determine location.

So on a still night in an open field where you’re listening hard for a gunshot and being quiet yourself, and someone empties half a magazine, well at a mile it might still be DC 10.

In the middle of a day as you walk past a construction site paying attention mostly to your Uber pick up time, and someone fires a single shot a mile away in a city might be a Natural 20 Only.