mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 07:36:39 +08:00
Merge 554901daee
into 6ded4e96e7
This commit is contained in:
commit
777a6dbbda
@ -1,3 +1,4 @@
|
||||
import { eld } from "eld";
|
||||
import { useDebouncedCallback } from "use-debounce";
|
||||
import React, {
|
||||
useState,
|
||||
@ -104,6 +105,7 @@ import {
|
||||
REQUEST_TIMEOUT_MS,
|
||||
UNFINISHED_INPUT,
|
||||
ServiceProvider,
|
||||
MS_EDGE_TTS_VOICES,
|
||||
} from "../constant";
|
||||
import { Avatar } from "./emoji";
|
||||
import { ContextPrompts, MaskAvatar, MaskConfig } from "./mask";
|
||||
@ -1222,7 +1224,11 @@ function _Chat() {
|
||||
const { markdownToTxt } = require("markdown-to-txt");
|
||||
const textContent = markdownToTxt(text);
|
||||
if (config.ttsConfig.engine !== DEFAULT_TTS_ENGINE) {
|
||||
const edgeVoiceName = accessStore.edgeVoiceName();
|
||||
const detectLang = eld.detect(text).language;
|
||||
const edgeVoiceName =
|
||||
detectLang in MS_EDGE_TTS_VOICES
|
||||
? MS_EDGE_TTS_VOICES[detectLang as keyof typeof MS_EDGE_TTS_VOICES]
|
||||
: accessStore.edgeVoiceName();
|
||||
const tts = new MsEdgeTTS();
|
||||
await tts.setMetadata(
|
||||
edgeVoiceName,
|
||||
|
@ -289,6 +289,66 @@ export const DEFAULT_TTS_VOICES = [
|
||||
"nova",
|
||||
"shimmer",
|
||||
];
|
||||
export enum MS_EDGE_TTS_VOICES {
|
||||
am = "am-ET-MekdesNeural",
|
||||
ar = "ar-AE-FatimaNeural",
|
||||
az = "az-AZ-BanuNeural",
|
||||
be = "en-US-AlloyMultilingualNeural",
|
||||
bg = "bg-BG-KalinaNeural",
|
||||
bn = "bn-IN-TanishaaNeural",
|
||||
ca = "ca-ES-JoanaNeural",
|
||||
cs = "cs-CZ-VlastaNeural",
|
||||
da = "da-DK-ChristelNeural",
|
||||
de = "de-DE-ConradNeural",
|
||||
el = "el-GR-AthinaNeural",
|
||||
en = "en-US-AndrewNeural",
|
||||
es = "es-ES-ElviraNeural",
|
||||
et = "et-EE-AnuNeural",
|
||||
eu = "eu-ES-AinhoaNeural",
|
||||
fa = "fa-IR-DilaraNeural",
|
||||
fi = "fi-FI-SelmaNeural",
|
||||
fr = "fr-FR-DeniseNeural",
|
||||
gu = "gu-IN-DhwaniNeural",
|
||||
he = "he-IL-HilaNeural",
|
||||
hi = "hi-IN-AaravNeural",
|
||||
hr = "hr-HR-GabrijelaNeural",
|
||||
hu = "hu-HU-NoemiNeural",
|
||||
hy = "hy-AM-AnahitNeural",
|
||||
is = "is-IS-GudrunNeural",
|
||||
it = "it-IT-ElsaNeural",
|
||||
ja = "ja-JP-NanamiNeural",
|
||||
ka = "ka-GE-EkaNeural",
|
||||
kn = "kn-IN-SapnaNeural",
|
||||
ko = "ko-KR-SunHiNeural",
|
||||
lo = "lo-LA-KeomanyNeural",
|
||||
lt = "lt-LT-OnaNeural",
|
||||
lv = "lv-LV-EveritaNeural",
|
||||
ml = "ml-IN-SobhanaNeural",
|
||||
mr = "mr-IN-AarohiNeural",
|
||||
ms = "ms-MY-YasminNeural",
|
||||
nl = "nl-NL-FennaNeural",
|
||||
no = "nb-NO-PernilleNeural",
|
||||
or = "or-IN-SubhasiniNeural",
|
||||
pa = "pa-IN-OjasNeural",
|
||||
pl = "pl-PL-AgnieszkaNeural",
|
||||
pt = "pt-PT-RaquelNeural",
|
||||
ro = "ro-RO-AlinaNeural",
|
||||
ru = "ru-RU-SvetlanaNeural",
|
||||
sk = "sk-SK-ViktoriaNeural",
|
||||
sl = "sl-SI-PetraNeural",
|
||||
sq = "sq-AL-AnilaNeural",
|
||||
sr = "sr-Latn-RS-NicholasNeural",
|
||||
sv = "sv-SE-SofieNeural",
|
||||
ta = "ta-IN-PallaviNeural",
|
||||
te = "te-IN-ShrutiNeural",
|
||||
th = "th-TH-PremwadeeNeural",
|
||||
tl = "en-US-AlloyMultilingualNeural",
|
||||
tr = "tr-TR-EmelNeural",
|
||||
uk = "uk-UA-PolinaNeural",
|
||||
ur = "ur-IN-GulNeural",
|
||||
vi = "vi-VN-HoaiMyNeural",
|
||||
zh = "zh-CN-YunxiNeural",
|
||||
}
|
||||
|
||||
const openaiModels = [
|
||||
"gpt-3.5-turbo",
|
||||
|
6
app/global.d.ts
vendored
6
app/global.d.ts
vendored
@ -41,3 +41,9 @@ declare interface Window {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
declare module "eld" {
|
||||
export const eld: {
|
||||
detect: (text: string) => { language: string };
|
||||
};
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"@vercel/speed-insights": "^1.0.2",
|
||||
"axios": "^1.7.5",
|
||||
"eld": "^1.0.0",
|
||||
"emoji-picker-react": "^4.9.2",
|
||||
"fuse.js": "^7.0.0",
|
||||
"heic2any": "^0.0.4",
|
||||
|
@ -3952,6 +3952,11 @@ eastasianwidth@^0.2.0:
|
||||
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
|
||||
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==
|
||||
|
||||
eld@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eld/-/eld-1.0.0.tgz#507cf2229fe3d809430fdfc3689edafeb53aafc1"
|
||||
integrity sha512-+wehmSoVbWYIsQ0wDUN6b1QCGNvnfT49KD/W6QavCEq8D5/ANx+B+qy5m2sKOTh3MyBqMEDTUxc1wcajSAo/2Q==
|
||||
|
||||
electron-to-chromium@^1.4.284:
|
||||
version "1.4.345"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.345.tgz#c90b7183b39245cddf0e990337469063bfced6f0"
|
||||
|
Loading…
Reference in New Issue
Block a user