Hi Guys,
I have a few projects where pics make sounds (as do a lot of us I imagine).
In a few projects I have used a small 1 Watt amplifier to drive a loudspeaker.

All is good, but I hear a little hum from the amp when it's supposed to be silent.
If the project has a flashing LED or the like, I then Hear a hum flashing at two different frequencies.
I assume this is interference from the pic itself.

A solution I'm thinking of is to leave the amplifier on all the time,
but to allow the pic to switch on the speaker only while a sound is being played.
The interference is inaudible while a sound is actually playing.

My question is.. What is a suitable circuit to achieve this?
The amplifier chip is a TDA2822M.
Cheers, Art.