import { copyChannelsAndDownmix } from "./core/audio-channels.js";
import { SpeechChannelSelector } from "./core/speech-channel-selector.js";
class PcmProcessor extends AudioWorkletProcessor {
    selector = new SpeechChannelSelector();
    process(inputs, outputs) {
        const mono = copyChannelsAndDownmix(inputs[0] ?? [], outputs[0] ?? [], this.selector);
        if (mono)
            this.port.postMessage(mono.buffer, [mono.buffer]);
        return true;
    }
}
registerProcessor("realtime-subtitles-pcm", PcmProcessor);
