Audio isolation transformer
For consumer generic audio connections, the audio signal (a varying AC voltage of about one volt) is compared to the ground of the system. Hence the two connectors on an RCA connector, signal and ground, or three connectors on a stereo jack: left, right, and ground. If your ground happens to be varying up and down at 60 times a second (because it's not a good ground, for instance), you will also get that hum on your output.
For some professional audio systems, the reference ground is brought with the signal, so you have three connections for any channel. When both the signal and ground vary up and down in sync, it's easy to subtract the pickup noise and have a clean signal.
In simple, single systems, either approach works fine. The problem is when you start interconnecting equipment.
I made a stereo isolation audio transformer to solve this problem. The left and right channels enter a 1:1 600ohm audio transformer, which transmits the audio signal (which is AC) but blocks any DC connection. This prevents ground loops and currents between the two devices. I got the two transformers from old modems. One of the jacks is a fancy panel mount, the other is from an old sound card, and this old one is actually needed, because it is plastic, isolating it from the case, which is connected to the ground of the panel mount jack. Of course, I put everything in an Altoids tin.
I suppose it would also help if I put some ferrite on the inputs to also reduce RFI/EMI problems, but I haven't yet. Just having this device between a shortwave radio and a PC has reduced interference pickup quite a bit.
You can see more photos of the build at http://www.flickr.com/photos/dwarmstr/sets/72157604679420753/. Essentially, 1. Measure and Mark your holes. 2. Make a small punch to keep drill centered. 3. Drill a pilot hole, then the right size. 4. Solder the connections. I used a multimeter to figure out which connection was which on the transformers. 5. Hot glue for stability.
Parts cost: about $2.50 for the 3.5mm stereo panel mount. Everything else I scrounged for from old parts, not counting my time. Here's the equivalent commercial product at $32: http://www.amazon.com/3-5mm-Stereo-Audio-Isolation-Transformer/dp/B001GUS7EO. I do enjoy the look of that commercial case.