Craigster has it right. The amount of sound is determined by the pressure of the gas when the bullet exits the muzzle.
Shorter barrel = more pressure.
Longer barrel = less pressure.
Larger charge of longer burning powder = more pressure at bullet exit.
All that said, you're not likely to take much notice of 3dB differences (-50%, +100%).
This all sounds logical. But I would propose there is at least one additional variable: perhaps direction of exiting gasses?
Witness the "loudness" of a rifle with a muzzle brake versus a similar rifle without a brake.