fix(frontend): #1897 声音克隆页增加情绪语速设置 #1906

Merged
xiaoxia merged 4 commits from fix/1897-voice-clone-preview-emotion-speed into develop 2026-09-14 19:11:00 +08:00
Owner

背景

Fix #1897

独立声音克隆页面(/app/voice-clone)目前没有情绪/语速 UI 控件,试听 API 只传 text 参数。后端 preview 接口已支持 speed 和 emotion 参数,前端补控件并真实传参。

修改

API 层

  • api/voice-clone/clones.ts: getVoiceClonePreview(cloneId, text?, options?) 新增 options 参数 {speed?, emotion?},通过 searchParams 透传到后端

新增组件

  • pages/voice-clone/components/VoiceClonePreviewPanel.tsx: 试听面板
    • 音色选择下拉(仅展示就绪音色,默认选中第一个)
    • 试听文本 textarea(默认文案,最多200字)
    • 语速滑块: 复用配音库 TTS 弹窗的 SpeedControl(0.5x-2.0x,默认1.0x)
    • 情绪下拉: 复用 EmotionControl(自然/兴奋/沉稳/友好,默认natural)
    • 试听按钮: 调 getVoiceClonePreview 传 text/speed/emotion,完成后渲染 audio controls
    • 合成中显示 LoadingOutlined,按钮禁用

修改

  • pages/voice-clone/VoiceClone.tsx: PageHead 下方、卡片网格上方插入 VoiceClonePreviewPanel(仅当存在就绪音色时显示,空状态/加载中不显示)
  • pages/voice-clone/voice-clone.css: 新增试听面板样式(.vc-preview-*),复用现有 CSS 变量

设计说明

  • 组件复用: 语速/情绪控件直接从配音库 tts-modal 目录 import,不重复造轮子
  • 语言不做: 克隆音色的语言由训练音频决定,合成时不可切换(按工单要求)
  • 不破坏卡片上原 sample_url 播放按钮: 新面板是独立的自定义文本实时 TTS 试听能力
  • 参数真实传递到后端 preview 接口,不是 UI 摆设

验收

  • 我的音色页(有就绪音色时)顶部显示试听面板
  • 可选音色、输入文本、调语速/情绪后点试听,真实向后端发请求
  • 空状态不显示面板
  • CI 全绿
## 背景 Fix #1897 独立声音克隆页面(/app/voice-clone)目前没有情绪/语速 UI 控件,试听 API 只传 text 参数。后端 preview 接口已支持 speed 和 emotion 参数,前端补控件并真实传参。 ## 修改 ### API 层 - `api/voice-clone/clones.ts`: `getVoiceClonePreview(cloneId, text?, options?)` 新增 options 参数 `{speed?, emotion?}`,通过 searchParams 透传到后端 ### 新增组件 - `pages/voice-clone/components/VoiceClonePreviewPanel.tsx`: 试听面板 - 音色选择下拉(仅展示就绪音色,默认选中第一个) - 试听文本 textarea(默认文案,最多200字) - 语速滑块: 复用配音库 TTS 弹窗的 SpeedControl(0.5x-2.0x,默认1.0x) - 情绪下拉: 复用 EmotionControl(自然/兴奋/沉稳/友好,默认natural) - 试听按钮: 调 getVoiceClonePreview 传 text/speed/emotion,完成后渲染 audio controls - 合成中显示 LoadingOutlined,按钮禁用 ### 修改 - `pages/voice-clone/VoiceClone.tsx`: PageHead 下方、卡片网格上方插入 VoiceClonePreviewPanel(仅当存在就绪音色时显示,空状态/加载中不显示) - `pages/voice-clone/voice-clone.css`: 新增试听面板样式(.vc-preview-*),复用现有 CSS 变量 ## 设计说明 - 组件复用: 语速/情绪控件直接从配音库 tts-modal 目录 import,不重复造轮子 - 语言不做: 克隆音色的语言由训练音频决定,合成时不可切换(按工单要求) - 不破坏卡片上原 sample_url 播放按钮: 新面板是独立的自定义文本实时 TTS 试听能力 - 参数真实传递到后端 preview 接口,不是 UI 摆设 ## 验收 - 我的音色页(有就绪音色时)顶部显示试听面板 - 可选音色、输入文本、调语速/情绪后点试听,真实向后端发请求 - 空状态不显示面板 - CI 全绿
xiaoxia added 4 commits 2026-09-14 18:19:11 +08:00
- api/voice-clone/clones.ts: getVoiceClonePreview 增加 options 参数(speed/emotion),通过 searchParams 透传
- 新增 VoiceClonePreviewPanel 组件:音色选择下拉、试听文本框、语速滑块(复用 SpeedControl)、情绪下拉(复用 EmotionControl)、试听按钮,试听完成后可直接播放音频
- VoiceClone.tsx:PageHead 下方、卡片网格上方插入试听面板(仅当存在就绪音色时显示)
- voice-clone.css:新增试听面板样式(复用现有 CSS 变量,风格与页面一致)
- 语速 0.5x-2.0x 默认1.0x;情绪 natural/excited/calm/friendly 默认natural
- 不加语言选择(克隆音色语言由训练时确定)
- 参数真实传递到后端 preview 接口
- api/voice-clone/clones.ts: getVoiceClonePreview 增加 options 参数(speed/emotion),通过 searchParams 透传
- 新增 VoiceClonePreviewPanel 组件:音色选择下拉、试听文本框、语速滑块(复用 SpeedControl)、情绪下拉(复用 EmotionControl)、试听按钮,试听完成后可直接播放音频
- VoiceClone.tsx:PageHead 下方、卡片网格上方插入试听面板(仅当存在就绪音色时显示)
- voice-clone.css:新增试听面板样式(复用现有 CSS 变量,风格与页面一致)
- 语速 0.5x-2.0x 默认1.0x;情绪 natural/excited/calm/friendly 默认natural
- 不加语言选择(克隆音色语言由训练时确定)
- 参数真实传递到后端 preview 接口
- api/voice-clone/clones.ts: getVoiceClonePreview 增加 options 参数(speed/emotion),通过 searchParams 透传
- 新增 VoiceClonePreviewPanel 组件:音色选择下拉、试听文本框、语速滑块(复用 SpeedControl)、情绪下拉(复用 EmotionControl)、试听按钮,试听完成后可直接播放音频
- VoiceClone.tsx:PageHead 下方、卡片网格上方插入试听面板(仅当存在就绪音色时显示)
- voice-clone.css:新增试听面板样式(复用现有 CSS 变量,风格与页面一致)
- 语速 0.5x-2.0x 默认1.0x;情绪 natural/excited/calm/friendly 默认natural
- 不加语言选择(克隆音色语言由训练时确定)
- 参数真实传递到后端 preview 接口
fix(frontend): #1897 声音克隆页增加情绪/语速设置
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 58s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m9s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 1m59s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 2m16s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 5m36s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 10s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 22s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 44h33m39s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 44h39m16s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 44h39m20s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 44h39m24s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 44h33m41s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 44h39m25s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 44h39m19s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 44h39m24s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 44h39m25s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 44h38m52s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 44h38m56s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 44h38m57s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 44h33m13s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 44h33m13s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 44h38m52s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 44h38m57s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 44h38m46s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 44h38m51s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 44h38m53s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 44h38m46s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 45h8m35s
7ba85b6ddf
- api/voice-clone/clones.ts: getVoiceClonePreview 增加 options 参数(speed/emotion),通过 searchParams 透传
- 新增 VoiceClonePreviewPanel 组件:音色选择下拉、试听文本框、语速滑块(复用 SpeedControl)、情绪下拉(复用 EmotionControl)、试听按钮,试听完成后可直接播放音频
- VoiceClone.tsx:PageHead 下方、卡片网格上方插入试听面板(仅当存在就绪音色时显示)
- voice-clone.css:新增试听面板样式(复用现有 CSS 变量,风格与页面一致)
- 语速 0.5x-2.0x 默认1.0x;情绪 natural/excited/calm/friendly 默认natural
- 不加语言选择(克隆音色语言由训练时确定)
- 参数真实传递到后端 preview 接口
xiaoxia merged commit 939a49d1d4 into develop 2026-09-14 19:11:00 +08:00

🗑️ 预览环境已清理

PR #1906 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1906 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.