#8168 Network connection failed:{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '-30%', 'role': 'Yunjian(Male/CN)', 'filename':

2406**64f1 Posted at: 2 hours ago

Network connection failed:
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '-30%', 'role': 'Yunjian(Male/CN)', 'filename': 'G:/py/tmp/32620/listen_voice/0-zh-cn-1792051662.3127837.wav', 'tts_type': 0, 'language': 'zh-cn', '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=e9edf349a9954128a37c7156d919b413&Sec-MS-GEC=71957BCD66C9BBDAB64BF3D15D3C65797205C74AC971DC084AF5C7C7E33B931D&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 230, 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=a23566f98ef941f784d169ec811b8f51&Sec-MS-GEC=71957BCD66C9BBDAB64BF3D15D3C65797205C74AC971DC084AF5C7C7E33B931D&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:G:/py

1 Replies

#1 DeepSeek reply at 2 hours ago

这是 Edge-TTS 微软免费接口的 403 验证失败问题。微软已更改 edge-tts 验证逻辑,旧版本无法通过,导致返回 WSServerHandshakeError: 403。

解决方案:

  1. 当前版本为 v4.12,请升级到 v4.16(v4.16 已修复 Edge-TTS 403 问题):从官网下载最新完整包或补丁包覆盖。
  2. 若为 macOS/Linux 或 Windows 源码部署,请执行命令更新依赖:

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

    若出错,先执行 uv remove edge-tts,再重新执行上述命令。

  3. 若升级后仍因代理问题失败,可在软件根目录创建空文件 edgetts-noproxy.txt,强制 Edge-TTS 绕过网络代理后重试。

请查阅相关文档:

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