#7017 Value: 'Same as the voice reference' (type: <class 'str'>) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情

2605**15ff Posted at: 1 hour ago

Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'zh_female_cn.wav', 'filename': 'D:/ALL/MY_SOFT_20251024/AI/win-pyvideotrans-v4.11/tmp/8892/listen_voice/12-zh-cn-1788337010.1767583.wav', 'tts_type': 12, 'language': 'zh-cn', 'volume': '+0%', 'pitch': '+0Hz'}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 233, in run
File "videotrans\tts\_base.py", line 130, in run
videotrans.configure.excepts.DubbingSrtError: Value: 'Same as the voice reference' (type: ) is not in the list of choices: ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制']


=
system:Windows-10-10.0.26200-SP0
version:v4.11
frozen:True
language:zh
root_dir:D:/ALL/MY_SOFT_20251024/AI/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 1 hour ago

这是 Index-TTS 本地服务启用了中文界面(i18n 翻译),导致其 API 下拉选项是中文,而 pyVideoTrans 发送的是英文 Same as the voice reference,两者不匹配引发参数校验报错。

解决方法

  1. 进入你本地部署的 Index-TTS 项目根目录
  2. 找到并打开 webui.py 文件
  3. 全局搜索字符串:i18n("与音色参考音频相同")
  4. 将其直接替换为英文:Same as the voice reference
  5. 保存文件并重启 Index-TTS 服务
  6. 回到 pyVideoTrans 重新执行任务

如果搜索不到该字符串,也可以直接把对应的下拉列表选项值改为英文,例如将 ['与音色参考音频相同', '使用情感参考音频', '使用情感向量控制'] 改为 ['Same as the voice reference', 'Use emotion reference audio', 'Use emotion vector control']

备用方案

如果不想修改 Index-TTS 源码,可以在 pyVideoTrans 软件根目录下新建 gradio_api.txt 文件,按如下格式填写并保存:

emo_control_method=与音色参考音频相同
prompt=tts_audio
text=tts_text
lang_choice=ZH
emo_ref_path=tts_audio
api_name=/gen_single

然后在软件中 设置 → TTS设置 → 自定义TTS API 填入你的 Index-TTS WebUI 地址(如 http://127.0.0.1:7860/),并在主界面配音渠道选择自定义接口,角色列表中选择对应参考音频。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource