function Compressor() {
    var _this;
    compressor_classCallCheck(this, Compressor);
    _this = _super.call(this);
    /**
     *
     * The p5.Compressor is built with a <a href="https://www.w3.org/TR/webaudio/#the-dynamicscompressornode-interface"
     *   target="_blank" title="W3 spec for Dynamics Compressor Node">Web Audio Dynamics Compressor Node
     *   </a>
     * @property {AudioNode} compressor
     */

    _this.compressor = _this.ac.createDynamicsCompressor();
    _this.input.connect(_this.compressor);
    _this.compressor.connect(_this.wet);
    return _this;
  }
Compressor is an audio effect class that performs dynamics compression
on an audio input source. This is a very commonly used technique in music
and sound production. Compression creates an overall louder, richer,
and fuller sound by lowering the volume of louds and raising that of softs.
Compression can be used to avoid clipping (sound distortion due to
peaks in volume) and is especially useful when many sounds are played
at once. Compression can be used on indivudal sound sources in addition
to the main output.

This class extends <a href = "/reference/#/p5.Effect">p5.Effect</a>.
Methods <a href = "/reference/#/p5.Effect/amp">amp()</a>, <a href = "/reference/#/p5.Effect/chain">chain()</a>,
<a href = "/reference/#/p5.Effect/drywet">drywet()</a>, <a href = "/reference/#/p5.Effect/connect">connect()</a>, and
<a href = "/reference/#/p5.Effect/disconnect">disconnect()</a> are available.

@class p5.Compressor
@constructor
@extends p5.Effect
 @example
<div><code>
let sound, compressor, playing;

function preload() {
  sound = loadSound('assets/beat.mp3');
}

function setup() {
  let cnv = createCanvas(100, 100);
  cnv.mouseClicked(togglePlay);
  sound.disconnect();
  compressor = new p5.Compressor();
  compressor.process(sound);

  textAlign(CENTER, CENTER);
  fft = new p5.FFT();
}

function draw() {
  background(220);
  // Constrain mouse Y position between 0 and -100
  let threshold = -constrain(mouseY, 0, 100);
  compressor.threshold(threshold);

  // Draw a rectangle based on the compressor reduction
  fill(255, 0, 255, 70);
  rect(0, 0, width, -compressor.reduction());

  fill(0);
  if (playing) {
    text('Threshold: ' + round(threshold), width / 2, 20);
  } else {
    text('Tap to play', width / 2, 20);
  }
  // Draw a line to indicate the threshold
  stroke(0);
  line(0, mouseY, width, mouseY);
  drawSpectrum();
}

function togglePlay() {
  if (playing) {
    playing = false;
    sound.pause();
  } else {
    playing = true;
    sound.loop();
  }
}

function drawSpectrum() {
  let spectrum = fft.analyze();
  noStroke();
  fill(255, 0, 255);
  for (let i = 0; i < spectrum.length; i++){
    let x = map(i, 0, spectrum.length, 0, width);
    let h = -height + map(spectrum[i], 0, 255, height, 0);
    rect(x, height, width / spectrum.length, h);
  }
}
</code></div>