Barrel length also plays a large role in how quiet a gun can be. My baby barret, m4gery, and sr722 all have barrels longer than 21" and are very tolerable with standard velocity ammo without using a can.
On the other hand, my 22lr builds with 1.5-4" barrels are some of the loudest pistols I've fired.
CCI quiet "semi auto" ammo helps a ton too, even with the shorter barrels. Aguilla sniper subsonic is really nice just harder to find and some guns don't cycle it well.