If you have first hand experience, I'd love to know how your ears survived.
Ask a veteran. Then, speak UP, and ask them again!
I've done it, and had it done while I was in the room /vehicle. Even the smallest rounds DO cause hearing damage!!!! The more powder burned (along with the auditory geometry of the location) the greater the damage.
This is someplace where most movies and TV shows DO NOT accurately portray real life. Not even close, most of the time. There are a few modern war movies where a shell explodes near the character, and there is no sound heard for a minute or so (the SHORT time of deafness is a lie, done to keep the audience from leaving....)
It can be hours, or days (and possibly longer) before your hearing returns to what you think of as normal. And, it never comes back ALL THE WAY!
We don't realize it, at first, because it takes special testing (with an established baseline) to show the damage..at first. We're all immortal and invulnerable, until we're not....The damage is cumulative, and permanent.
When the word you use most in conversation is "what??", and you find you NEED the subtitles to know what the actors are saying (and you need help reading them, ), when you can't make out what the person next to you in a crowded room is saying, THEN its hard to ignore, but until then, most don't realize they have been injured.
The famous "auditory exclusion" (adrenaline, tunnel vision, etc.) only affects what the brain perceives, at the time. The ear hears the shot, SAME AS ALWAYS, and is damaged by it. Your brain, being very focused on something else (like an attack) doesn't recognize the shot the same way, but the physical sound and the damage it causes is there even if you don't notice it, or only notice it after things calm down.