setInput(source, smoothing) {
    p5sound.meter.disconnect();

    if (smoothing) {
      this._workletNode.parameters.get('smoothing').value = smoothing;
    }

    // connect to the master out of p5s instance if no snd is provided
    if (source == null) {
      console.log(
        'Amplitude input source is not ready! Connecting to main output instead'
      );
      p5sound.meter.connect(this._workletNode);
    }

    // connect to the sound if it is available
    else if (source) {
      source.connect(this._workletNode);
      this._workletNode.disconnect();
      this._workletNode.connect(this.output);
    }

    // otherwise, connect to the master out of p5s instance (default)
    else {
      p5sound.meter.connect(this._workletNode);
    }
  }
Connects to the p5sound instance (main output) by default.
 Optionally, you can pass in a specific source (i.e. a soundfile).

 @method setInput
 @for p5.Amplitude
 @param {soundObject|undefined} [snd] set the sound source
                                      (optional, defaults to
                                      main output)
 @param {Number|undefined} [smoothing] a range between 0.0 and 1.0
                                       to smooth amplitude readings
 @example
 <div><code>
 function preload(){
   sound1 = loadSound('assets/beat.mp3');
   sound2 = loadSound('assets/drum.mp3');
 }
 function setup(){
   cnv = createCanvas(100, 100);
   cnv.mouseClicked(toggleSound);

   amplitude = new p5.Amplitude();
   amplitude.setInput(sound2);
 }

 function draw() {
   background(220);
   text('tap to play', 20, 20);

   let level = amplitude.getLevel();
   let size = map(level, 0, 1, 0, 200);
   ellipse(width/2, height/2, size, size);
 }

 function toggleSound(){
   if (sound1.isPlaying() && sound2.isPlaying()) {
     sound1.stop();
     sound2.stop();
   } else {
     sound1.play();
     sound2.play();
   }
 }
 </code></div>