I've set up a simple LM386 amplifier on a breadboard according to the above schematic. When connected, the amplifier works like a charm driving a spare 8Ω speaker with impressively low (audible) noise.
On the input (pin 3) I'm connecting just the left channel of a 3.5mm audio jack.
When no source is connected to the jack and the power is switched on I get a significant buzz coming from the amplifier, which is worsened when a 3.5mm audio cable is plugged in. However, as soon as I connect the other end of the cable to a source (phone/MP3 player etc.) the buzz stops completely.
I assume this is a grounding issue and that I'm essentially making a big aerial the moment I connect an unterminated cable. This is inconvenient as there might well be times when the amplifier is switched on but a source isn't hooked up.
Question: Why does this happen, and how do I prevent noise/buzz when no source is connected to the input?