#5661 wave.Error: # channels not specified

2409:8a1e* Posted at: 8 hours ago

:
Traceback (most recent call last):
File "urllib\request.py", line 1348, in do_open
File "http\client.py", line 1283, in request
File "http\client.py", line 1329, in _send_request
File "http\client.py", line 1278, in endheaders
File "http\client.py", line 1038, in _send_output
File "http\client.py", line 976, in send
File "http\client.py", line 1448, in connect
File "http\client.py", line 942, in connect
File "socket.py", line 857, in create_connection
File "socket.py", line 845, in create_connection
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\tts\_piper.py", line 75, in _exec
File "piper\voice.py", line 401, in synthesize_wav

for audio_chunk in self.synthesize(

File "piper\voice.py", line 285, in synthesize

sentence_phonemes = self.phonemize(text)

File "piper\voice.py", line 192, in phonemize

phonemizer = ChinesePhonemizer(self.download_dir / "g2pW")

File "piper\phonemize_chinese.py", line 210, in init

download_model(model_dir)

File "piper\phonemize_chinese.py", line 381, in download_model

with urlopen(G2PW_URL) as response:

File "urllib\request.py", line 216, in urlopen
File "urllib\request.py", line 519, in open
File "urllib\request.py", line 536, in _open
File "urllib\request.py", line 496, in _call_chain
File "urllib\request.py", line 1391, in https_open
File "urllib\request.py", line 1351, in do_open
urllib.error.URLError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 19, in run
File "videotrans\tts\__init__.py", line 207, in run
File "videotrans\tts\_base.py", line 93, in run
File "videotrans\tts\_piper.py", line 95, in _exec
File "videotrans\tts\_piper.py", line 74, in _exec
File "wave.py", line 332, in exit
File "wave.py", line 444, in close
File "wave.py", line 462, in _ensure_header_written
wave.Error: # channels not specified


=
system:Windows-10-10.0.19045-SP0
version:v4.04
frozen:True
language:zh
root_dir:D:/APP/win-pyvideotrans-v4.04-0704

1 Replies

这是由于 Piper 配音渠道需要从网络下载中文音素化模型(g2pW),但由于网络连接超时导致下载失败,引起后续异常。

解决步骤:

  1. 更换配音渠道:推荐使用 Edge-TTS(免费),无需额外下载模型,开箱即用。在主界面 Dubbing Channel 中选择 Edge-TTS,并在 Select Voice 中选择合适的中文发音人(如 zh-CN-XiaoxiaoNeural)。
  2. 配置网络代理:如果你所在网络环境无法直接访问模型下载源(如 Hugging Face),请在主界面 网络代理 处填写可用的代理地址(格式 http://127.0.0.1:端口),重试 Piper 渠道。
  3. 手动下载模型(不推荐,较复杂):将 g2pW 模型文件手动放置到 models/ 目录下(具体文件名需参考 Piper 代码)。但更简单的方法是换用渠道。

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource