This module is the implementation of an opto resistive coupler NSL32

Dynamic compression of audio signals is essential to reduce peaks
 The principle is quite simple. The input stage consists of a series resistance with the resistance of the NSL32 in the foot. This is comparable to an attenuator which will be driven by the detection of a threshold crossed. The internal LED of the NSL32 will light up and its resistance will decrease. So here is how it works.
The attached document from the builder Advancedphotonix is really well done to develop and adapt your project. 
 The change I made is that I am using a dual operational amp. I therefore inserted a Buffer between the audio output and the detection cell. Hey idea, if we interrupt the link of this cell, we create the function "Compressor OFF". If you force the transistor to the state of saturation by V + on the 5K1 with a non-return diode all the same, you create the MUTE function.
 In the jargon, it is also called Vactrol. It is also used in effects pedals as well as in analog synthesizer VCAs. The reputation of "warm sound" is obtained with this technique compared to FET which is drier.
Placed after a preamp to bring it to line level, it will level the signal of 2 speakers when taking a single microphone.
If this module needs to attack a mixer insert socket, I recommend IN & OUT buffers for the 2 jacks. I made sure that each section was non-inverting. This avoids phase problems in the case of "Bypass".
This method, I use it regularly because there is a difference between the world of the laboratory and the reality of the field.Let's take the case of a filter, if in the laboratory you have a generator with low impedance output and a measuring device with high impedance, your tests will be conclusive. Now, put audio plugs in IN & OUT and connect it as is, your filter will may become an oscillator. This is the purpose of the buffer stages. Adopt this technique, you will not be disappointed for your next DIY. You will gain in stability of your assemblies.
Where can I find the NSL32? At some large component distributors but also in a more modest way at a German distributor of parts and components for guitar: .http://www.banzaimusic.com/Silonex-NSL32SR3.html. Plus, they have "SPARE" for your vintage gear.