fix(frontend): #1898 配音库AI配音增加情绪语言选择 #1904
Reference in New Issue
Block a user
Delete Branch "fix/1898-tts-emotion-language"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
Fix #1898
配音库 AI 配音弹窗(TtsModal)目前只有语速滑块,缺少情绪和语言选择。后端 CosyVoice 已完整支持 emotion/language 参数透传(Schema 已定义),本次前端补控件并真实传参。
修改
新增组件(与 SpeedControl 风格一致,原生 select,沿用 CSS 变量)
tts-modal/constants.ts:TTS_EMOTION_OPTIONS(自然/兴奋/沉稳/亲切,默认 natural)、TTS_LANGUAGE_OPTIONS(中文 zh-CN/英文 en/日文 ja/韩文 ko,默认 zh-CN)、类型与默认值tts-modal/EmotionControl.tsx:情绪下拉tts-modal/LanguageControl.tsx:语言下拉修改
api/tts/types.ts:TTSSynthesizeRequest增加emotion?: string;TTSPreviewRequest增加language?: stringtts-modal/types.ts:TtsModalProps新增 ttsEmotion/ttsLanguage/onEmotionChange/onLanguageChangecomponents/TtsModal.tsx:在 VoiceSelector 下方用 grid 两列布局放 EmotionControl + LanguageControl,再放 SpeedControlcomponents/VoiceModals.tsx:透传 4 个新增 propshooks/useTtsSynthesize.ts:新增 ttsEmotion/ttsLanguage 状态(含默认值)、synthesizeSpeech 请求体带 emotion/language、关闭弹窗时重置、return 暴露状态与 settersVoiceLibrary.tsx:解构新状态,传给 VoiceModals设计说明
验收
CI全绿,自动审批通过。
CI全绿,自动审批通过。
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #1904 已关闭或合并,对应的预览环境已被清理。