Distortion
Distortion can be caused (in this amp, assuming everyting is connected like it should be) by one of four causes:
- Speakers gets overloaded - small speakers cannot handle a lot of power so it produces distortion if you try to play the music too loud, it probably would distort the low frequencies first as low frequencies require bigger cone travel.
- The amplifier output gets overloaded - if the chip (or the power supply) cannot produce enough current, then it will clip the waveform and produce distortion.
- Not enough voltage - 8 Ohm speaker needs 8VRMS to produce 8W of power. As you use a single supply and capacitor coupling, it means that the peak output of your amplifier is about half of the power supply voltage. So, to get 8VRMS (11.3Vpeak) the power supply as to be at least 22.6V, in practice it probably would need to be more than that because the output transistors in the chip drop some voltage. Otherwise there will be not enough voltage and the waveform will be clipped (the chip cannot have 14V on its output if the power supply is 12V)
- The amplifier input get overloaded - the input voltage is too high for the amplifier chip This is not very likely for your project, but I included it for completeness sake.
Buzzing
The input picks up the electromagnetic field from the mains wires inside your house and amplifies them as if they were useful signal. To reduce the hum, you should put the amplifier in a metal case to shield it. It would still pick up some hum when the input is not connected to anything (or worse, connected to a wire which is not connected to anything), but that is not really important.
Also, the hum could be coming from the power supply (if you use a non-switching power supply) if there is insufficient filtering (not enough capacitors).
Resistor in series
It will not work - putting resistor in series with the input you will just lower the volume while putting the resistor in series with the speaker will reduce the output power because you will be wasting some power on the resistor. The amp will just start clipping at lower volume.
My suggestion
Find out the power of your speaker. Connect it to another (more powerful) amplifier and turn the volume up until you hear distortion. Note if the volume is flouder than with your amp or not. If it is the same, then you need a more powerful speaker.
If the chip can survive it (read the datasheet), use a higher voltage power supply, especially if you want to use an 8 ohm speaker. Or find a 4 ohm speaker - it would need less voltage for the same power (if your chip can drive 4 ohm speakers).
For learning about op-amps and their problems, I'm tempted to suggest App Note 47; it's very long and focuses more on higher speed applications, but it has a lot of practical information on debugging this kind of system.
"How can you learn from experience if you can't identify the problem and just hope the circuit works the next time you attemt to build it?"
You have to localise the problem, even if that's just to one half of the circuit or another. You have to either build up from something known to work, or dismantle down to a definitely faulty core.
You need a model of the system, either a mental one or a simulation. Then you need to find out where the reality differs from the model. For audio stuff, this will involve poking around with an osciliscope a lot.
Best Answer
With the exception of power op-amps, op-amps are not suitable for driving loudspeakers. The impedance of speakers is too low. You need a power amplifier chip for driving speakers, or to add a class B emitter-follower output stage made using two complementary power transistors.
Some op-amps are much more noisy than others. They produce noise and it cannot be eliminated; it is inherent to the op-amp. If you're doing audio work, and the circuitry doesn't have to be very low power, use an audiophile op-amp IC like LM4562 or the cheaper workhorse that is nearly as good: NE5532.
But neither of those will drive an 8 ohm speaker, or even a 32 ohm headphone speaker.
Also, do not expect to get anywhere near the 0V and 9V power rails with the signal swing. It's not realistic. Even if you get an op-amp that can do it, the speaker-driving output stage will not. I wouldn't plan on more than a +/- 2V displacement from the 4.5V middle bias, staying several volts clear of either power rail.
I sketched up the circuit below to illustrate the class B emitter follower output stage idea. The op-amp is basically used as a buffer with a modest voltage gain of 2 to interface the input to the output stage. You don't need a high gain because the available voltage swing is not so high. The output stage will only swing the voltage on the speaker to about +/- 2V before clipping. If the input signal is already +/- 1V, the gain headroom is only 2!
Note how everything is very similar to your original schematic, except that we have added the output stage, connected the feedback resistor R2 not from the op-amp output, but all the way from the output stage. This includes the output stage in the feedback loop, and so the feedback loop will cancel some of the distortion introduced by the output stage, such as its crossover distortion.
We still have serious problem here in that the output stage's input impedance is still too low for the op-amp! It's not nearly as bad as an 8 ohm speaker, but look at those 470 ohm resistors. Basically, they have to be considered in parallel, and so the input impedance is only about 230 ohms! Their values can be raised, but this cuts into our already limited voltage swing. We can fix that by using pairs of transistors in the output stage, to increase its current gain.
I can think of an op-amp off the top of my head which can handle this impedance as it is: the NJM4556. The op-amps on this chip can drive 150 ohm loads.
simulate this circuit – Schematic created using CircuitLab