The shock wave around the bullet is what makes that bang when it goes by. The bullet also makes a loud bang when it hits something or someone. There are actually three bangs: one at the muzzle, one from the shock wave, one from the impact. I’ll never forget the first time I heard a machinegun firing some distance away and being puzzled by the “echoes” which were there three noises from each shot fired. I had only the impression from movies - and they use blanks in movies.
Ah, thanks.