The difference between a rifle and BB gun is the gas pressure at bullet escapement is above 2 atmospheres in the rifle. The gas ball expands faster than the speed of sound. When the gas ball slows to the speed of sound, a sound wave propagates with amplitude 2A and trough at cavitation [0 Atmosphere]. Deer rifles might show 10,000 psi muzzle pressure in Quickload. That does not tell how big the gas ball will be at the threshold. The bore and chamber volume as well as grains of powder are part of the equation. A big gas ball will propagate waves down to 1/2 wavelength of its diameter. This is why cannons go boom with a deep sound. The distance from the gas ball to the ear may cause amplitude roll off a 1/r^2 for far field or 1/r for near field, but that is not as important as reflected sound. Some ranges are noisy.

I took EE360 acoustics from Rubens Siegelman in 1976 when he was developing ultrasound at the Univ of WA.

But professors could not answer why CB shorts were noisy with 22" barrels and BB gun Quiet with 24" barrels. The guy who figured that out for me was the late gunsmith Randy Ketchum in 1995. The guy who figured out the 1 atmosphere above ambient math for me was a recording engineer in CA [biker] in 2005. The calculation of the reflections was in the Cohen book I read as a teen ager in the 1960s
https://www.biblio.com/book/hi-fi-loudspeakers-enclosures-cohen-abraham/d/570314656


There is nothing noble in being superior to your fellow man; true nobility is being superior to your former self. -Ernest Hemingway
The man who makes no mistakes does not usually make anything.-- Edward John Phelps