import { SpeechChannelSelector } from "./speech-channel-selector.js";
export function copyChannelsAndDownmix(input, output, selector = new SpeechChannelSelector()) {
    const frameLength = input[0]?.length ?? 0;
    if (frameLength === 0)
        return undefined;
    for (let channel = 0; channel < output.length; channel++) {
        const source = input[channel] ?? input[0];
        output[channel].set(source.subarray(0, output[channel].length));
    }
    return selector.select(input);
}
