#8948 OpenAI TTS: Voice

67.21**6 Posted at: 29 minutes ago

OpenAI TTS: Voice "alloy" is not available on engine "v4". See GET /v1/voices?engine=v4 for the ids available there.
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'role': 'alloy', 'filename': 'F:/创业/win-pyvideotrans-v4.19/tmp/1904/1795530284.6448944-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': 'Voice "alloy" is not available on engine "v4". See GET /v1/voices?engine=v4 for the ids available there.', 'type': 'invalid_request_error', 'param': 'voice', '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 29 minutes ago

这不是软件 bug,而是你填写的 API 地址并非 OpenAI 官方接口,而是第三方中转/兼容服务。报错里的 engine "v4" 与 GET /v1/voices?engine=v4 这种措辞,OpenAI 官方接口不会有;该服务的音色 ID 命名与官方(alloy/echo/fable/onyx/nova/shimmer)不同,所以 alloy 被判定为不存在。

解决步骤:

  1. 打开你的服务商控制台,或直接访问 https://你的API地址/v1/voices?engine=v4,查该服务实际支持的音色 ID(可能是 alloy-v4、openai-alloy、zh_female_xx 等自定义名)。
  2. 菜单 → 翻译设置 → OpenAI TTS,确认 API 地址 和 密钥 确实指向该中转服务(而不是官方),然后选用上一步查到的可用音色 ID。
  3. 若软件该渠道的音色下拉框中没有你需要的 ID,说明软件内置的音色列表与你的服务不匹配,此时改用 自定义 TTS API 渠道(按软件要求的返回格式对接),或直接换用 Edge-TTS(免费) 等其它配音渠道。
  4. 修改后先点 试听 验证能出声,再执行正式任务。

补充:若你本意是走 OpenAI 官方接口,则需把 API 地址改回官方地址并确保密钥为官方 Key,此时 alloy 可用。

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