text: Sound is made by vibrations of the air (or other medium). Vibrations are caused by many means, and a gunfire is one of them. It is called "explosion". It moves the air particles at the end of the barrel in random ways, by expulsion of the combusted gun powder gasses and by the movement of the bullet. \n\nThe first reason of the sound is uncontrolled expansion of gasses at the end of the barrel, that cause air particle to vibrate at various frequencies for a short time, while gasses move them apart from one antoher.\n\nThe second reason is the bullet breaking the sound barrier when exiting the barrel. It's average velocity is 450 m/s up to 1200 m/s. If speed of sound at 20oC and 1 atm is cca 340 m/s, it is clear that sound barrier is broken, which causes "boom".\n\nSo, mixture of those two sounds make sound of a gun fire.