#8661 Network connection failed:{'text': 'Hello, my dear friend, I hope every day of yours is wonderful and joyful!', 'rate':

2409**2bf1 Posted at: 1 hour ago

Network connection failed:
{'text': 'Hello, my dear friend, I hope every day of yours is wonderful and joyful!', 'rate': '+0%', 'role': 'Brian(Male/US)', 'filename': 'C:/Users/study/tools/tmp/19800/listen_voice/0-en-1793803062.0686529.wav', 'tts_type': 0, 'language': 'en', 'volume': '+0%', 'pitch': '+0Hz'}
Traceback (most recent call last):
File "edge_tts\communicate.py", line 566, 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&ConnectionId=a53511ac26c24982bcc4987cb9318d37&Sec-MS-GEC=52DB37D23127E6BB98B8CC03529957601DB7C3E4EE7086F0B04D25EACDEDA70F&Sec-MS-GEC-Version=1-143.0.3650.75'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 232, in run
File "videotrans\tts\_base.py", line 94, in run
File "asyncio\runners.py", line 44, in run
File "asyncio\base_events.py", line 649, in run_until_complete
File "videotrans\tts\_edgetts.py", line 154, in _exec
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&ConnectionId=e1f8f704db1d49a7b0203c81fd810e46&Sec-MS-GEC=52DB37D23127E6BB98B8CC03529957601DB7C3E4EE7086F0B04D25EACDEDA70F&Sec-MS-GEC-Version=1-143.0.3650.75'


=
system:Windows-10-10.0.19045-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:C:/Users/study/tools

1 Replies

#1 DeepSeek reply at 1 hour ago

这是 Edge-TTS 渠道的微软免费接口返回 403 拒绝(WSServerHandshakeError: 403),v4.12 版本的 edge-tts 组件版本较旧,已无法通过微软的验证逻辑,属于已知问题。

解决方案

  1. 升级到 v4.16 或更新版本(首选)。

    • 下载最新补丁包并完整覆盖到旧目录(务必连同 _internal、videotrans 文件夹一起覆盖,不能只覆盖 sp.exe)。
    • 覆盖前建议先删除 _internal 文件夹内所有 __pycache__ 文件夹,避免缓存导致旧代码残留。
  2. 若你使用的是源码部署版本(当前是 frozen 打包版,可忽略此步),执行:

    uv add git+https://github.com/rany2/edge-tts.git

    若报错,先执行 uv remove edge-tts 再重新执行上面的命令。

  3. 升级后仍有偶发 403 时,降低请求频率:

    • 菜单 → 工具/选项 → 高级选项 → 字幕配音调整:将 EdgeTTS配音渠道配音并发数 设为 1,配音后暂停秒 设为 5~10。
    • 若填写了网络代理且代理不稳定,可在软件根目录新建空文件 edgetts-noproxy.txt,强制 Edge-TTS 绕过代理。
  4. 若升级后仍失败,可直接改用其他配音渠道,如 Qwen3-TTS(内置)、OmniVoice(内置)、ZipVoice(内置),或在线 API 渠道(豆包语音合成2.0、fish.audio 等)。

请查阅相关文档:

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