fix: distinguish automatic local language from legacy English captures

This commit is contained in:
Blendman974 committed 2026-11-06 02:13:43 +01:00
1 parent 44e4cd7300
commit c5b57e85b0
3 files changed
+9 -3

No files matched your search

+3 -2
View File
@@ -14,7 +14,7 @@ export type VoiceProviderSelection = {
provider: VoiceProviderKind;
/**
* Spoken language the provider should expect (ISO 639-1); empty lets it
* detect the language. Cloud providers only.
* detect the language. Also used by on-device Whisper.
*/
language?: string;
elevenLabsApiKey: string;
@@ -77,7 +77,8 @@ function isConfigured(provider: CloudProvider, selection: VoiceProviderSelection
* to expect. A running capture is shared only by holders asking for the same.
*/
export function transcriptionKey(selection: Pick<VoiceProviderSelection, "provider" | "language">): string {
return `${selection.provider}:${(selection.language ?? "").trim().toLowerCase()}`;
const fallback = selection.provider === "onboard-whisper" ? "en" : "";
return `${selection.provider}:${(selection.language ?? fallback).trim().toLowerCase()}`;
}
/** Whether createCloudSttClient would return a cloud client for this selection. */