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

2600:1f14* Posted at: 13 hours ago 👁14

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=xby.wav&prompt_text=%C2%BFDe+verdad+crees+que+una+mujer+tiene+que+trabajar+para+ayudarte+a+pagar+las+cuentas%3F+Si+piensas+as%C3%AD%2C+est%C3%A1s+perdiendo+tu+papel.&prompt_lang=es&speed_factor=1.0:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 18, in run
File "videotrans\tts\__init__.py", line 291, in run
File "videotrans\tts\_base.py", line 177, in run
File "videotrans\tts\_gptsovits.py", line 112, in _item_task
File "videotrans\tts\_gptsovits.py", line 90, in _run
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=xby.wav&prompt_text=%C2%BFDe+verdad+crees+que+una+mujer+tiene+que+trabajar+para+ayudarte+a+pagar+las+cuentas%3F+Si+piensas+as%C3%AD%2C+est%C3%A1s+perdiendo+tu+papel.&prompt_lang=es&speed_factor=1.0


=
system:Windows-10-10.0.19045-SP0
version:v3.89
frozen:True
language:zh
root_dir:H:/win-pyvideotrans-3.89

1 Replies

这是由于 GPT-SoVITS API 服务在处理请求时返回了 400 错误,通常与请求参数(特别是参考音频和提示文本)不匹配或格式错误有关。

解决方案:

  1. 检查 GPT-SoVITS API 服务:确保你启动的 GPT-SoVITS 服务版本正确,并且其 API 接口地址为 http://127.0.0.1:9880
  2. 核对请求参数:根据错误信息,请求中包含了 ref_audio_path(参考音频路径)和 prompt_text(提示文本)。请确保:

    • ref_audio_path=xby.wav 这个音频文件确实存在于 GPT-SoVITS 服务可访问的路径下。
    • prompt_text 的内容(西班牙语)与 ref_audio_path 音频的实际内容一致。GPT-SoVITS 要求提示文本与参考音频的内容严格对应,用于声音克隆。
  3. 简化测试:在 pyVideoTrans 的“TTS设置”中,切换到 GPT-SoVITS 渠道,尝试在不使用参考音频(即不使用克隆功能,使用内置音色)的情况下进行测试,以确认基础连接是否正常。
  4. 查阅详细指南:请按照 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.

Related resource

Similar issues already exist