title: Replacing scriptProcessorNode with AudioWorklet
body: <p>I am working on recording microphone input from the user and processing it. The problem is that I am using scriptProcessorNode to process data, but <a href="https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createScriptProcessor" rel="nofollow noreferrer">here</a> it said that is has been deprecated and replaced with <a href="https://webaudio.github.io/web-audio-api/#audioworklet" rel="nofollow noreferrer">AudioWorklet</a>.The problem is that there is no clear way to replace this functionality with AudioWorklet, and from all of the <a href="https://googlechromelabs.github.io/web-audio-samples/audio-worklet/#design-pattern" rel="nofollow noreferrer">example projects with AudioWorklets</a> from Google, none of them is doing anything with microphone input. Is there a way to replace this code with Audio Worklet? Here is the code that "should" be replaced.</p>
  
  <pre><code>    // Connect analyser
      this.options.source.connect(this.analyser);
      // Create ScriptProcessorNode
      this.scriptProcessorNode = this.options.context.createScriptProcessor(this.options.bufferLen, numChannels, numChannels);
      // Connect scriptProcessorNode (Theretically, not required)
      this.scriptProcessorNode.connect(this.options.context.destination);
      // Create callback to update/analyze floatFrequencyData
      var self = this;
      this.scriptProcessorNode.onaudioprocess = function (event) {
          self.analyser.getFloatFrequencyData(self.floatFrequencyData);
          self.update();
          self.store(event);
          self.monitor();
      };
      // Connect scriptProcessorNode
      this.options.source.connect(this.scriptProcessorNode);
  </code></pre>