fix(frontend): #1898 配音库AI配音增加情绪语言选择
- TTS 弹窗新增情绪下拉(自然/兴奋/沉稳/亲切,默认自然)和语言下拉(中文/英文/日文/韩文,默认中文) - 新增 EmotionControl、LanguageControl 组件,与 SpeedControl 风格一致(tts-modal 目录下) - useTtsSynthesize hook 管理 emotion/language 状态,关闭弹窗时重置 - synthesizeSpeech 请求真实传递 emotion 和 language 参数到后端 - VoiceModals/VoiceLibrary 全链路透传新增 props - api/tts/types 的 TTSSynthesizeRequest 和 TTSPreviewRequest 补充 emotion/language 类型
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import React from "react"
|
||||
import { TTS_LANGUAGE_OPTIONS, type TtsLanguage } from "./constants"
|
||||
|
||||
interface LanguageControlProps {
|
||||
language: TtsLanguage
|
||||
onChange: (language: TtsLanguage) => void
|
||||
}
|
||||
|
||||
/** 语言选择下拉 */
|
||||
const LanguageControl: React.FC<LanguageControlProps> = ({ language, onChange }) => {
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
style={{
|
||||
fontSize: 13,
|
||||
color: "var(--text-secondary)",
|
||||
marginBottom: 6,
|
||||
}}
|
||||
>
|
||||
语言
|
||||
</div>
|
||||
<select
|
||||
value={language}
|
||||
onChange={(e) => onChange(e.target.value as TtsLanguage)}
|
||||
style={{
|
||||
width: "100%",
|
||||
padding: "7px 10px",
|
||||
borderRadius: 6,
|
||||
border: "1px solid var(--border-color, #e5e7eb)",
|
||||
background: "var(--bg-primary, #fff)",
|
||||
color: "var(--text-primary)",
|
||||
fontSize: 13,
|
||||
outline: "none",
|
||||
cursor: "pointer",
|
||||
}}
|
||||
>
|
||||
{TTS_LANGUAGE_OPTIONS.map((opt) => (
|
||||
<option key={opt.value} value={opt.value}>
|
||||
{opt.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default LanguageControl
|
||||
Reference in New Issue
Block a user