mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-28 16:55:36 +00:00
22 lines
670 B
TypeScript
22 lines
670 B
TypeScript
import type { CompanionAudioCandidate } from "../types";
|
|
|
|
export type CaptionAudioCandidate = {
|
|
path: string;
|
|
label: string;
|
|
};
|
|
|
|
export function getCaptionCompanionAudioCandidates(
|
|
companions: CompanionAudioCandidate[],
|
|
): CaptionAudioCandidate[] {
|
|
return companions.flatMap((companion) => {
|
|
const candidates: CaptionAudioCandidate[] = [];
|
|
if (companion.usablePaths.includes(companion.micPath)) {
|
|
candidates.push({ path: companion.micPath, label: "microphone audio sidecar" });
|
|
}
|
|
if (companion.usablePaths.includes(companion.systemPath)) {
|
|
candidates.push({ path: companion.systemPath, label: "system audio sidecar" });
|
|
}
|
|
return candidates;
|
|
});
|
|
}
|