Okay, I see what you are trying to do. The problem is that the LED only conducts in one direction, so, fed with a sine wave, it is off 1/2 the time (actually more than that because it needs about 2V before it conducts). The on off threshold is the click you are hearing.
Does the fucntion...