#3555 字幕翻译结束等待下一步配音阶段Traceback (most recent call last): File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in runloop

154.3* Posted at: 4 hours ago 👁7

字幕翻译结束等待下一步
配音阶段

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_running_loop()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_edgetts.py", line 61, in _create_audio_with_retry

communicate = Communicate(

File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\communicate.py", line 333, in init

self.tts_config = TTSConfig(voice, rate, volume, pitch, boundary)

File "", line 8, in init
File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\data_classes.py", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_

......
", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_running_loop()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_edgetts.py", line 61, in _create_audio_with_retry

communicate = Communicate(

File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\communicate.py", line 333, in init

self.tts_config = TTSConfig(voice, rate, volume, pitch, boundary)

File "", line 8, in init
File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\data_classes.py", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_running_loop()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_edgetts.py", line 61, in _create_audio_with_retry

communicate = Communicate(

File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\communicate.py", line 333, in init

self.tts_config = TTSConfig(voice, rate, volume, pitch, boundary)

File "", line 8, in init
File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\data_classes.py", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_running_loop()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_edgetts.py", line 61, in _create_audio_with_retry

communicate = Communicate(

File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\communicate.py", line 333, in init

self.tts_config = TTSConfig(voice, rate, volume, pitch, boundary)

File "", line 8, in init
File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\data_classes.py", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str
[67] errors, 0 succeed
Traceback (most recent call last):
File "d:\pyvideotrans\videotrans\tts\_base.py", line 127, in run

loop = asyncio.get_running_loop()

RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "d:\pyvideotrans\cli.py", line 490, in

main()

File "d:\pyvideotrans\cli.py", line 479, in main

vtv_fun({**common_params, **vtv_params})

File "d:\pyvideotrans\cli.py", line 281, in vtv_fun

trk.dubbing()

File "d:\pyvideotrans\videotrans\task\trans_create.py", line 702, in dubbing

self._tts()

File "d:\pyvideotrans\videotrans\task\trans_create.py", line 979, in _tts

run_tts(

File "d:\pyvideotrans\videotrans\tts\__init__.py", line 324, in run

EdgeTTS(**kwargs).run()

File "d:\pyvideotrans\videotrans\tts\_base.py", line 189, in run

raise self.error

File "d:\pyvideotrans\videotrans\tts\_edgetts.py", line 61, in _create_audio_with_retry

communicate = Communicate(

File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\communicate.py", line 333, in init

self.tts_config = TTSConfig(voice, rate, volume, pitch, boundary)

File "", line 8, in init
File "d:\pyvideotrans.venv\lib\site-packages\edge_tts\data_classes.py", line 54, in post_init

raise TypeError("voice must be str")

TypeError: voice must be str

d:\pyvideotrans>

1 Replies

这是由于 Edge-TTS 配音渠道的 voice 参数类型错误导致的。核心错误是 TypeError: voice must be str,表明传递给 Edge-TTS 的配音角色参数不是字符串类型。

解决方案:

  1. 检查并重新选择配音角色:在软件主界面的“配音渠道”行,确保“配音角色”下拉框已正确选择了一个具体的发音人(例如 zh-CN-XiaoxiaoNeural),而不是空值或非字符串选项。
  2. 检查目标语言:确保“目标语言”已正确选择,因为配音角色列表会根据目标语言动态加载。
  3. 重置或重新启动软件:如果上述操作无效,尝试关闭软件并重新启动,然后重新配置任务。
  4. 检查高级设置:进入 菜单 -> 工具 -> 高级选项 -> 字幕配音调整,确保“并发配音线程数”设置合理(对于 Edge-TTS,建议设为 1 以避免 403 错误),“配音后暂停秒数”建议设为 5-10 秒。
  5. 使用命令行模式时的检查:如果您使用的是命令行模式 (cli.py),请检查传递给 --voice_role 参数的值是否是一个有效的字符串(例如用引号包裹)。

如果问题依然存在,请提供您当前使用的软件版本以及任务配置的详细截图或命令行参数。

请查阅相关文档:

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