Two sources for the bark a gun makes. 1) sonic crack and 2) gas escape at the muzzle. There is a distinct correlation between volume of sound and gas pressure when the bullet leaves the muzzle. More pressure = more volume. Shorter barrels mean higher pressure if all else is equal.