Gunshot Sound
Each gunshot sound you hear in game has propagation delay based on distance between source and the listener
The propagation velocity is 340m/s so if a pistol is shot 340m away from the listener, he will see the muzzle flash first and hear the gunshot after 1 second
If gunshot is fired from indoor or there is no direct or approximate line of sight (obstructed), the reverb effect and LPF are applied to the sound effect
Bullet Crack/Whizz Effect
Bullet crack effect (or bullet bow shockwave) is generated when a supersonic projectile passes in close proximity to the listener. The effect can be heard in a closest point on bullet trajectory line.
Basically, the sound source is always perpendicular to the trajectory line, so if you hear a bullet crack just in your left headphone, you know that the shooter is either directly in front of you, or behind you
Most of our weapons are supersonic. This means that you will hear the crack/whizz before you hear the actual gunshot
In a scenario where you see a shooter 1000m away, using AWM (>900m/s muzzle velocity) the events will occur in such order:
1. You see the muzzle flash
2. After ~1 sec you hear the crack/whizz (assuming no air drag)
3. After ~3 sec you hear the gunshot
Bullets passing close to the player will generate a crack sound, the ones passing further away will only generate whizz effect
We blend between different sound samples based on distance (the maximum distance and attenuation characteristic is also affected by suppressor attachment). The close gunshot sounds louder and more clear than the distant one
In the current public build, all bullets generate a sound crack effect. We've changed this mechanic by adding a velocity check, so bullets travelling slower than speed of sound will not generate the crack effect but just whizz.