#7828 :{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'coral', 'filename': 'C:\\Users\\Administrator\\AppData\\

38.148**9 Posted at: 2 hours ago

:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'coral', 'filename': 'C:\Users\Administrator\AppData\Local\Temp/pyvideotrans/22-1791190822.5382059.wav', 'tts_type': 22, '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 122, 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 28, in _run
File "openai\_client.py", line 194, in init
openai.OpenAIError: Missing credentials. Please pass an api_key, workload_identity, admin_api_key, or set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable.


=
system:Windows-10-10.0.19045-SP0
version:v4.15
frozen:True
language:zh_CN
root_dir:E:/yinwenzhuan/win-pyvideotrans-v4.15

1 Replies

#1 DeepSeek reply at 2 hours ago

报错核心原因:tts_type: 22 对应的是 OpenAI-TTS 配音渠道,但你未在软件中配置 OpenAI 的 API Key,导致初始化 OpenAI 客户端时抛出 Missing credentials 错误。

解决方案:

  1. 配置密钥:点击顶部菜单 翻译设置(Translation Settings) 或 TTS设置,找到 OpenAI / OpenAI-TTS 设置项,填入你的 api_key(也需填写正确的 API地址,若使用官方则保持默认,使用中转则填中转地址)并保存。
  2. 若不想用 OpenAI:将配音渠道从 OpenAI-TTS 切换为默认推荐的 Edge-TTS(免费),重新选择中文音色(如 zh-CN-XiaoxiaoNeural),无需任何密钥即可试听。
  3. 注意:role: coral 是 OpenAI-TTS 的音色之一,仅在 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