As many of you know, when using PWM, the speaker will click or pop when PWM is turned on. Then it will click again when PWM is turned off. Do you guys know a way that I can remove this? I'm thinking maybe some way to ramp up the voltage slowly on the PWM output before the song plays so that the speaker doesn't slam so hard. I'm using the arduino uno right now.
The Arduino Tone library is just for simple tones. http://arduino.cc/en/Reference/tone
The ToneAC has less clicks, and no clicks when the frequency is changed. http://playground.arduino.cc/Code/ToneAC It uses two pins and the speaker between it.
You could add a low-pass filter, to remove the nasty high frequency component of the click. Or a high-pass filter to get rid of the big speaker cone movement.
There are also audio amplifier chips with gain control and so on.
Could make your own audio with blink without delay style code: http://forum.arduino.cc/index.php?topic=179761.0 I don't get any pops/clicks, check the youtube link.