Oh My, power outages,help


We recently had a series of power outages. The first time was bad, as I leave my components on (SS amp - delayed shut off, tube pre-amp - no on/off switch, cd player, turntable & speakers). Loud noises through speakers as equipment power went off.

The second time was worse as I was listening to the stereo when the power went out. Volume level, of course was higher. Noise from the speakers was much louder, and this scared the s++t out of me. Thankfully no damage.

Is there anything I can do to safeguard my equipment, especially the speakers? The outage happened without warning, no inclement weather.
wildoats
yes, I have a surge protector for electricity from the outlet to my gear. However, that doesn't do anything for me as far as protecting my speakers from power outages.
I'm saying, when the power goes out at my house, that causes the same thing as if I was shutting off, say, the pre-amp before shutting off the amp. The act of shutting down (or losing power to) the pre-amp before the amp is off causes a loud popping sound in my speakers. My amp has delayed shutoff, meaning it retains power for about 15 seconds before it is totally off. I don't see how a surge protector will help me here. I can't put a surge protector between my amp and speakers can I?
I get the same thing. When I turn off the bathroom light, I hear this popping sound from my floorstanders. I thought that I have faulty electrical wiring inside the condo but I guess this could be power surges.