As
zentara just said and I posted in
Re: Does Perl ring a bell?, a simple optoisolator will help you out with a minimal # of components. A
4N27 is a good choice, and it's dirt cheap, less than $0.50USD in single quantities. Current capacity of the phototransistor is only 50 ma, so you need to keep your driver relay small. A larger one, with a FET output phototransistor, is an NTE 3085. This one can handle 100ma. In either case, you can pulse a higher-current relay safely, but be aware that the length of the pulse needed is longer that the actual "clap" you will end up with, due to the mechanical nature of the system.
Another possibility to explore is
Opto-22 Solid-State Relays and similar generic products. These are commonly available on the surplus market, and can be wired up (in carefully sealed boxes!!!) to control such things as coffeepots and other AC appliances. I buy them surplus for $5 - $10USD and they're just as easy to use as the little DIP versions. Take care, though. Playing with AC can be deadly if you do not protect your wiring. I usually mount the SSR inside a steel 4"x4" deep handi-box along with a regular outlet and 3-wire plug on SJ cord.
Be aware that once you start making your computer go "thump!" in the night (or "ding!", or "buzz", or ???), it's hard to stop. Embedded systems are some of the most fun computing systems around; they're highly addictive.