From e2841e200d4e10ab414d032e22a4773159eff6c0 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Tue, 15 Sep 2026 01:09:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(voices):=20TtsModal=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E9=9F=B3=E8=89=B2=E6=9D=A5=E6=BA=90=E5=88=87=E6=8D=A2=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=80=89=E9=A1=B9=EF=BC=88=E9=A2=84=E7=BD=AE=E9=99=90?= =?UTF-8?q?=20zh/en=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/src/pages/voices/components/TtsModal.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/web/src/pages/voices/components/TtsModal.tsx b/apps/web/src/pages/voices/components/TtsModal.tsx index 29ff0202f..953792f43 100755 --- a/apps/web/src/pages/voices/components/TtsModal.tsx +++ b/apps/web/src/pages/voices/components/TtsModal.tsx @@ -1,4 +1,4 @@ -import React from "react" +import React, { useMemo } from "react" import { Modal } from "antd" import { type TtsModalProps, type TtsStatus } from "./tts-modal/types" import TextInputSection from "./tts-modal/TextInputSection" @@ -9,6 +9,7 @@ import LanguageControl from "./tts-modal/LanguageControl" import SynthesizeButton from "./tts-modal/SynthesizeButton" import ErrorAlert from "./tts-modal/ErrorAlert" import ResultPanel from "./tts-modal/ResultPanel" +import { PRESET_TTS_LANGUAGE_OPTIONS, CLONE_TTS_LANGUAGE_OPTIONS } from "./tts-modal/constants" /** AI 配音弹窗 */ const TtsModal: React.FC = ({ @@ -32,6 +33,13 @@ const TtsModal: React.FC = ({ onSynthesize, onSave, }) => { + // 预置音色(含空默认)仅支持 zh/en;克隆音色支持全语言列表 + const isCloneVoice = useMemo( + () => !!ttsVoiceId && clonedVoices.some((v) => v.id === ttsVoiceId), + [ttsVoiceId, clonedVoices], + ) + const languageOptions = isCloneVoice ? CLONE_TTS_LANGUAGE_OPTIONS : PRESET_TTS_LANGUAGE_OPTIONS + return (
= ({ }} > - +