function phaseCancellationHandler(audioProcessingEvent) {
  const inputBuffer = audioProcessingEvent.inputBuffer;
  const outputBuffer = audioProcessingEvent.outputBuffer;

  const inputLeft = inputBuffer.getChannelData(0);
  const inputRight = inputBuffer.getChannelData(1);
  const outputLeft = outputBuffer.getChannelData(0);
  const outputRight = outputBuffer.getChannelData(1);

  for (let sample = 0; sample < inputLeft.length; sample++) {
    outputLeft[sample] = inputLeft[sample] - inputRight[sample];
    outputRight[sample] = inputRight[sample] - inputLeft[sample];
  }
}
/**
 * The processing function that phases-out the mono signal (usually the vocals)
 */
The processing function that phases-out the mono signal (usually the vocals)
The processing function that phases - out the mono signal ( usually the vocals )
function phaseCancellationHandler(audioProcessingEvent) {
  const inputBuffer = audioProcessingEvent.inputBuffer;
  const outputBuffer = audioProcessingEvent.outputBuffer;
  const inputLeft = inputBuffer.getChannelData(0);
  const inputRight = inputBuffer.getChannelData(1);
  const outputLeft = outputBuffer.getChannelData(0);
  const outputRight = outputBuffer.getChannelData(1);
  for (let sample = 0; sample < inputLeft.length; sample++) {
    outputLeft[sample] = inputLeft[sample] - inputRight[sample];
    outputRight[sample] = inputRight[sample] - inputLeft[sample];
  }
}
function phaseCancellationHandler ( audioProcessingEvent ) { const inputBuffer = audioProcessingEvent . inputBuffer ; const outputBuffer = audioProcessingEvent . outputBuffer ; const inputLeft = inputBuffer . getChannelData ( 0 ) ; const inputRight = inputBuffer . getChannelData ( 1 ) ; const outputLeft = outputBuffer . getChannelData ( 0 ) ; const outputRight = outputBuffer . getChannelData ( 1 ) ; for ( let sample = 0 ; sample < inputLeft . length ; sample ++ ) { outputLeft [ sample ] = inputLeft [ sample ] - inputRight [ sample ] ; outputRight [ sample ] = inputRight [ sample ] - inputLeft [ sample ] ; } }
The processing function that phases-out the mono signal (usually the vocals)
The processing function that phases - out the mono signal ( usually the vocals )