AIUI, active noise cancelling doesn't really work well for impulsive sources like gunshots because the impulse does not exist for enough time for predictive interference to function.
Additionally, because noise cancellation depends on the phase of the wave relative to the receivers (your ears) it really needs to be within ~1/4 wavelength of your ears, or 3" at 1kHz.
In gun ranges, what you would probably benefit most from is passive energy reduction, so ear protectors (already usually covered) and acoustical treatment. However, acoustical surface is very expensive where flat concrete is cheap, so you end up with gun ranges being big reverberative spaces instead.
The firearms headsets I've seen use a form of noise cancelling that is an electronic limiter that closes immediately upon excessive noise, so impulse noises like popping and crackling don't reach your ears. But otherwise, you can hear just fine (voices, even the wind).
Not that this would be practical but could you connect the gun to a speaker and just play the inverse of a pre-recorded gunshot?
You'd need to have lots of pre-recorded shots as I imagine there's some variation between guns, calibers, etc. but I wonder how well it could actually work.
Additionally, because noise cancellation depends on the phase of the wave relative to the receivers (your ears) it really needs to be within ~1/4 wavelength of your ears, or 3" at 1kHz.
In gun ranges, what you would probably benefit most from is passive energy reduction, so ear protectors (already usually covered) and acoustical treatment. However, acoustical surface is very expensive where flat concrete is cheap, so you end up with gun ranges being big reverberative spaces instead.