For those that are into audio production you’ll recognize the concept of optical coupling as the basis of the legendary LA-2A compressor.
The light source is driven by a DC amplifier that generates a control voltage derived from the audio signal. The light shines onto a photo-resistor that is used as the shunt component of an audio pad. (attenuator)
As the light intensity increases the pad reduces the signal level at the pad creating an audio compressor.