first thing is first...
*any* firearm set off is loud. Any firearm set off in the confines of an enclosed space is VERY loud.
If you ahve a .22, I suggest trying this ONCE (and only once): in the great outdoors, on a nice, clear day, go fired one round without hearing protection. Realize that that tiny bit of powder is producing THAT loud of a noise. Imagine what that noise will do inside a closed room, reverberating off the walls. Afterwards, put hearing protection on, and never repeat that exposure. Trust me, your ears will still ring for a good half hour afterwards.
Then think of a 12g blast confined inside a room. think BOOM!
this site has a pretty good discussion of hearing protection in hunting (not indoors):
http://www.nwtf.org/tips_adventures/adventures.php?id=277
As to shotty vs. pistol for home defense, there is something else you need to consider: your living space. Is your house all alone in the woods, with no neighbors nearby? Do you live in a cookie-cutter student apartment? Do you live in a cobb dwelling with many rock berms around it. Check out this site regarding overpenetration of walls and the like:
http://www.theboxotruth.com/ (seems to be down at the moment)
Keep in mind that your engagement distance in most urban houses is under the 40' mark for a hallway, and under the 16' mark for most rooms. At that distance, most shottys will have to be actually aimed, not just point and shoot, although you will have a bit more leeway than a handgun.
I would suggest sticks. Go out to the yard, and get some sticks, and have you and your partner and or kids play the aggressor and you the defender. Play assault the bedroom/kitchen/family room. Figure out what would work best for you in defending your home, the best place to stave off an invader and so on. While you are at it, check on your smoke detectors, fire extinguishers, and fire evac plans (especially with kids). Make it a safety afternoon