blob: 6d53ba84c7a79aeb699e83df4aab81816559ddb8 [file] [log] [blame]
/**
* @class CountProcessor
* @extends AudioWorkletProcessor
*
* This processor class just looks at the number of input channels on the first
* input and fills the first output channel with that value.
*/
class CountProcessor extends AudioWorkletProcessor {
constructor() {
super();
}
process(inputs, outputs, parameters) {
let input = inputs[0];
let output = outputs[0];
output[0].fill(input.length);
return true;
}
}
registerProcessor('counter', CountProcessor);