#2716 requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://127.0.0.1:9880/tts?text=%E4%BD%A0%E5%A5%BD%

107.149* Posted at: 11 hours ago 👁15

400 Client Error: Bad Request for url: http://127.0.0.1:9880/tts?text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B.+&text_lang=zh&ref_audio_path=%E8%8B%B1%E6%96%87%E5%8F%A3%E6%92%AD1.WAV&prompt_text=that+stands+for+Automated+Teller+Machine+Automated+Teller+Machine+and+that%27s+where+you+can+take+out+money+from+your+bank&prompt_lang=en&speed_factor=1.0:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 284, in run
File "videotrans\tts\_base.py", line 179, in run
File "videotrans\tts\_base.py", line 208, in _local_mul_thread
File "videotrans\tts\_gptsovits.py", line 98, in _item_task
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://127.0.0.1:9880/tts?text=%E4%BD%A0%E5%A5%BD%E5%95%8A%E6%88%91%E7%9A%84%E6%9C%8B%E5%8F%8B.+&text_lang=zh&ref_audio_path=%E8%8B%B1%E6%96%87%E5%8F%A3%E6%92%AD1.WAV&prompt_text=that+stands+for+Automated+Teller+Machine+Automated+Teller+Machine+and+that%27s+where+you+can+take+out+money+from+your+bank&prompt_lang=en&speed_factor=1.0


=
system:Windows-10-10.0.26100-SP0
version:v3.91
frozen:True
language:zh
root_dir:E:/fanyiruanjian

1 Replies

该错误表明 GPT-SoVITS 语音克隆服务返回了“400 Bad Request”。这通常是由于请求参数不匹配或格式错误导致的。请按以下步骤排查:

  1. 检查 GPT-SoVITS 服务状态:确保你的 GPT-SoVITS 服务已正确启动,并监听在 http://127.0.0.1:9880 端口。可以在浏览器中访问 http://127.0.0.1:9880/docs 查看 API 文档页面是否正常打开。
  2. 核对参考音频与提示文本:错误日志显示 ref_audio_path 为“英文口播1.WAV”,而 prompt_lang 为“en”,但 text_lang 为“zh”。请确保:

    • 参考音频的语言prompt_lang)与 待合成的文本语言text_lang必须一致。根据日志,你似乎试图用英文参考音频合成中文文本,这会导致错误。
    • 在 pyVideoTrans 的“配音角色”选择界面,确保你选择的“GPT-SoVITS”角色对应的参考音频语言与你要翻译/配音的目标语言一致。
  3. 检查音频文件路径:确保参考音频文件“英文口播1.WAV”存在于 GPT-SoVITS 服务能够访问的正确路径下(通常是其 reference_audio 目录或你指定的绝对路径)。
  4. 简化请求:如果问题依旧,尝试在 GPT-SoVITS 的 WebUI 中手动测试:

    • 使用相同的参考音频和一段简短的、语言匹配的文本进行合成,看是否成功。
    • 如果手动测试也失败,说明问题出在 GPT-SoVITS 模型或配置上,请检查其日志。
  5. 查看详细日志:如果以上步骤无法解决,请提供 pyVideoTrans 日志目录 (E:/fanyiruanjian/logs/) 下最新的日志文件,以及 GPT-SoVITS 服务端的日志,以便进一步分析。

请查看更多参考文档:

Post Your Reply
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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions