I used a photoresistor to vary the voltage that was the input for my speaker, thus allowing changes in light level to vary the volume the speaker functioned at.