#8950 OpenAI TTS: TTS synthesis failed: empty text{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'Kim Chi', 'filename': 'F:/创业

67.21**6 Posted at: 25 minutes ago

OpenAI TTS: TTS synthesis failed: empty text
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'Kim Chi', 'filename': 'F:/创业/win-pyvideotrans-v4.19/tmp/1904/1795530553.356865-openai.wav', 'tts_type': 24}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 125, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_openaitts.py", line 29, in _run
File "openai\_response.py", line 629, in enter
File "openai\resources\audio\speech.py", line 107, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.BadRequestError: Error code: 400 - {'error': {'message': 'TTS synthesis failed: empty text', 'type': 'api_error', 'param': None, 'code': None}}


=
system:Windows-10-10.0.19044-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:F:/创业/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 25 minutes ago

这是 TTS 服务端返回的 HTTP 400 错误(并非软件本地故障),说明你填写的 OpenAI 兼容接口没有拿到有效文本或有效音色参数,因此服务端判定 “empty text” 并拒绝合成。

重点排查以下三项:

  1. 音色名不合法:Kim Chi 不是 OpenAI 官方音色。官方 OpenAI TTS 音色为 alloy / echo / fable / onyx / nova / shimmer(新版另有 ash / ballad / coral / sage / verse)。若你填写的是第三方中转或聚合站地址,这些站点通常只支持自己定义的音色列表,填入不受支持的名字会被服务端直接判为无效请求。请先在 菜单 → 翻译设置 → OpenAI TTS 里改用该服务商明确支持的音色再试。
  2. API 地址与接口:菜单 → 翻译设置 → OpenAI TTS 中,官方地址应为 https://api.openai.com/v1;若使用中转站,必须确认其真正兼容 /v1/audio/speech 接口(很多聚合站只兼容 chat/completions,不兼容 speech),否则会返回各种 400 类错误。
  3. 文本兼容性测试:将文本换成简单内容(如 你好 或 hello)单独试听,确认是否为该服务端对中文长句处理异常。若简单文本仍报同样错误,则基本可锁定是音色名或接口地址问题。

若以上排查后仍报错,请提供:菜单 → 翻译设置 → OpenAI TTS 中填写的 API 地址(可隐去 key)、当前所选音色名称,以及该服务商是否声明支持 OpenAI 语音合成接口。

请查阅相关文档:

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