I'm following this tutorial for making an arduino uno .wav player with an lm386 amplifier. The only difference I see in my project is that I'm using a 1inch diameter speaker while the speaker in the tutorial is larger. My speaker is an 8ohm 2W speaker but the tutorial doesn't say what it uses.
When I play the wav file tmrpcm.play("song.wav");, I'm getting a rapid clicking noise. No music. When I play tone(9, 700,1000); I'm getting a very quiet tone, but not a clicking noise.
You are asking a relative complicated question without any real information. I give you credit for posting the links you did. The clicking sounds like something switching at about a 40 Hz rate. Posted are several good pictures but I do not have the time nor inkling to convert that to something more understandable like a schematic. Post a schematic, not a frizzy picture with links to technical information on the perternant components, we know capacitors and resistors unless special. Also show all power and ground connections and power sources.
tmrpcm.setVolume(9); The highest possible is 6. So 9 doesn't work.
tone(9, 700,1000); interferes with the tmrpcm.play("song.wav");. So I had to comment tone() out. It made the song stop after a second. Maybe the code plays the song at the same time as the tone and so when the tone is done it tells the speaker to stop playing all together?
I missed the connection of 4 and 2 to ground! Newbie mistake.
Now the amp works... well sort of. The .wav plays but it's not any louder than playing the wav without the amp. But the clicking issue is fixed.