#2788 配音阶段出错:[Edge-TTS(免费)] 网络连接失败:Traceback (most recent call last): File "videotrans\tts\_base.py", line 123, in runRuntime

155.117* Posted at: 5 days ago 👁29

配音阶段出错:[Edge-TTS(免费)] 网络连接失败:
Traceback (most recent call last):
File "videotrans\tts\_base.py", line 123, in run
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 224, in run
File "videotrans\task\trans_create.py", line 496, in dubbing
File "videotrans\task\trans_create.py", line 783, in _tts
File "videotrans\tts\__init__.py", line 279, in run
File "videotrans\tts\_base.py", line 188, in run
File "videotrans\tts\_edgetts.py", line 72, in _create_audio_with_retry
File "asyncio\tasks.py", line 445, in wait_for
File "edge_tts\communicate.py", line 590, in save
File "edge_tts\communicate.py", line 573, in stream
File "edge_tts\communicate.py", line 431, in __stream
File "aiohttp\client.py", line 1482, in aenter
File "aiohttp\client.py", line 1078, in _ws_connect
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://speech.platform.bing.com/consumer/speech/synthesize/readaloud/edge/v1?TrustedClientToken=6A5AA1D4EAFF4E9FB37E23D68491D6F4&Sec-MS-GEC=309DFEBCC1BB3337B1A261E336766D045743F82B58C88B52470BA838E1F31709&Sec-MS-GEC-Version=1-130.0.2849.68&ConnectionId=fb1468adb4c54f9eb6b986595fb4a6c3'

TaskCfg(cache_folder='E:/BaiduNetdiskDownload/win-pyvideotrans-v3.86/tmp/2216/e3008f03b9', target_dir='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4', remove_noise=False, is_separate=False, detect_language='ko', subtitle_language=None, source_language='韩语', target_language='简体中文', source_language_code='ko', target_language_code='zh-cn', source_sub='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4/ko.srt', target_sub='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4/zh-cn.srt', source_wav='E:/BaiduNetdiskDownload/win-pyvideotrans-v3.86/tmp/2216/e3008f03b9/ko.wav', source_wav_output='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4/ko.m4a', target_wav='E:/BaiduNetdiskDownload/win-pyvideotrans-v3.86/tmp/2216/e3008f03b9/target.wav', target_wav_output='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4/zh-cn.m4a', subtitles='', novoice_mp4='E:/BaiduNetdiskDownload/win-pyvideotrans-v3.86/tmp/2216/e3008f03b9/novoice.mp4', noextname='52._chs', shibie_audio=None, targetdir_mp4='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/_video_out/52._chs-mp4/52._chs.mp4', instrument=None, vocal=None, back_audio='', background_music=None, app_mode='biaozhun', subtitle_type=1, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Xiaoxiao(Female/CN)', copysrt_rawvideo=False, clear_cache=False, translate_type=4, tts_type=0, recogn_type=0, model_name='large-v3', split_type=0, voice_autorate=True, video_autorate=False, cuda=False, name='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画/52._chs.mp4', basename='52._chs.mp4', ext='mp4', dirname='E:/BaiduNetdiskDownload/A64 从Blender基础知识到3D动画', shound_del_name=None, uuid='e3008f03b9', remove_silent_mid=False, align_sub_audio=True, enable_diariz=False, nums_diariz=0, rephrase=1, only_out_mp4=True)

1 Replies

该错误是由于 Edge-TTS 服务端返回了 403 状态码,通常意味着您的网络请求被微软服务器拒绝。这可能是由网络代理设置、IP 地址限制或服务端临时问题导致的。

请按以下步骤尝试解决:

  1. 检查并调整网络代理设置

    • 如果您使用了代理,请确保代理服务器工作正常且未被微软服务屏蔽。
    • 在软件主界面第 5 行的“网络代理”处,可以尝试清空代理设置(留空)或更换其他可用的代理地址(格式如 http://127.0.0.1:7890)。
    • 重要:如果您的网络环境无需代理即可访问国际网络,请务必清空代理设置。
  2. 降低并发请求频率

    • 进入菜单栏的 工具 -> 高级选项
    • 在“配音调整”区域,将“同时配音字幕数”设置为 1
    • 将“配音后暂停时间/秒”适当增加,例如设置为 35
    • 这可以减少对 Edge-TTS 服务器的请求压力,避免触发其频率限制。
  3. 更换配音角色或渠道

    • 如果上述方法无效,Edge-TTS 服务可能暂时对您的 IP 或区域不可用。
    • 您可以暂时切换到其他配音渠道,例如 VITS-cnen(本地)piper-tts(本地),这些渠道无需网络连接,稳定性更高。
  4. 检查系统时间和时区

    • 确保您的 Windows 系统时间和时区设置正确。错误的时间可能导致 SSL 证书验证失败,间接引发连接问题。

如果问题持续存在,请提供 videotrans/logs/ 目录下最新的日志文件,以便进行更深入的分析。

请查看更多参考文档:

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