mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-11 09:58:14 +08:00
feat: add tts stt
This commit is contained in:
@@ -137,3 +137,34 @@ export function getISOLang() {
|
||||
const lang = getLang();
|
||||
return isoLangString[lang] ?? lang;
|
||||
}
|
||||
|
||||
const DEFAULT_STT_LANG = "zh-CN";
|
||||
export const STT_LANG_MAP: Record<Lang, string> = {
|
||||
cn: "zh-CN",
|
||||
en: "en-US",
|
||||
pt: "pt-BR",
|
||||
tw: "zh-TW",
|
||||
jp: "ja-JP",
|
||||
ko: "ko-KR",
|
||||
id: "id-ID",
|
||||
fr: "fr-FR",
|
||||
es: "es-ES",
|
||||
it: "it-IT",
|
||||
tr: "tr-TR",
|
||||
de: "de-DE",
|
||||
vi: "vi-VN",
|
||||
ru: "ru-RU",
|
||||
cs: "cs-CZ",
|
||||
no: "no-NO",
|
||||
ar: "ar-SA",
|
||||
bn: "bn-BD",
|
||||
sk: "sk-SK",
|
||||
};
|
||||
|
||||
export function getSTTLang(): string {
|
||||
try {
|
||||
return STT_LANG_MAP[getLang()];
|
||||
} catch {
|
||||
return DEFAULT_STT_LANG;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user