chromium/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioworklet-interface/processors/channel-count-processor.js

/**
 * @class ChannelCountProcessor
 * @extends AudioWorkletProcessor
 */
class ChannelCountProcessor extends AudioWorkletProcessor {
  constructor(options) {
    super(options);
  }

  process(inputs, outputs) {
    this.port.postMessage({
      inputChannel: inputs[0].length,
      outputChannel: outputs[0].length
    });
    return false;
  }
}

registerProcessor('channel-count', ChannelCountProcessor);