LM386 amplifier buzz when not connected to signal
Use a 10 k pull down resistor at the input rather like as shown in the standard circuit that uses a potentiometer: -



Without an impedance to ground (such as a 10 k resistor) you will get pick-up because the input is high impedance and any wire conencted to this will pick-up some signal. The pull-down resistor will reduce hum/noise when the input is not connected to a signal source.

Alternatively you can arrange for a jack socket to have a grounding contact the shorts the input to signal ground when nothing is plugged in: -