#4058 TaskCfgSTT(is_cuda=True, uuid='98d9d0f1de', cache_folder='/home/amu/pyvideotrans/tmp/443031/98d9d0f1de', target_dir='/ho

178.128* Posted at: 2 hours ago 👁8

语音识别阶段出错 [自定义识别API] 程序内部错误:未定义的变量 'None'
Traceback (most recent call last):
File "/home/amu/pyvideotrans/videotrans/task/job.py", line 105, in run

trk.recogn()

File "/home/amu/pyvideotrans/videotrans/task/_speech2text.py", line 159, in recogn

raw_subtitles = run(
                ^^^^

File "/home/amu/pyvideotrans/videotrans/recognition/__init__.py", line 243, in run

return APIRecogn(**kwargs).run()
       ^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/amu/pyvideotrans/videotrans/recognition/_base.py", line 143, in run

res = self._exec()
      ^^^^^^^^^^^^

File "/home/amu/pyvideotrans/videotrans/recognition/_recognapi.py", line 69, in _exec

return self._vibevoice_asr()
       ^^^^^^^^^^^^^^^^^^^^^

File "/home/amu/pyvideotrans/videotrans/recognition/_recognapi.py", line 288, in _vibevoice_asr

raise RuntimeError(f'VibeVoice:{self.api_url} not return data: all chunks failed')
                                                               ^^^^^^

UnboundLocalError: cannot access local variable 'result' where it is not associated with a value
TaskCfgSTT(is_cuda=True, uuid='98d9d0f1de', cache_folder='/home/amu/pyvideotrans/tmp/443031/98d9d0f1de', target_dir='/home/amu/pyvideotrans/output/recogn', source_language=None, source_language_code=None, source_sub=None, source_wav=None, source_wav_output=None, target_language=None, target_language_code=None, target_sub='/home/amu/pyvideotrans/output/recogn/www.xiaoyuzhoufm.com - vol.47 有问必答|真正的蓄能,是看清自己的起心动念.srt', target_wav=None, target_wav_output=None, name='/home/amu/www.xiaoyuzhoufm.com - vol.47 有问必答|真正的蓄能,是看清自己的起心动念.m4a', noextname='www.xiaoyuzhoufm.com - vol.47 有问必答|真正的蓄能,是看清自己的起心动念', basename='www.xiaoyuzhoufm.com - vol.47 有问必答|真正的蓄能,是看清自己的起心动念.m4a', ext='m4a', dirname='/home/amu', shound_del_name=None, detect_language='zh-cn', recogn_type=20, model_name='large-v3-turbo', shibie_audio='/home/amu/pyvideotrans/tmp/443031/98d9d0f1de/www.xiaoyuzhoufm.com - vol.47 有问必答|真正的蓄能,是看清自己的起心动念-1776142363.4853745.wav', remove_noise=True, enable_diariz=True, nums_diariz=0, rephrase=0, fix_punc=False)


=
system:Linux-6.19.11-061911-generic-x86_64-with-glibc2.39
version:v3.98
frozen:False
language:zh
root_dir:/home/amu/pyvideotrans
Python: 3.12.13 (main, Mar 24 2026, 22:49:22) [Clang 22.1.1 ]

1 Replies

这是由于自定义语音识别 API(VibeVoice-ASR)服务未返回有效数据,且代码中存在一个变量未定义的错误。

  1. 检查 VibeVoice-ASR 服务状态:确保你部署的 VibeVoice-ASR API 服务正在运行且可访问。在终端中检查其运行状态,并尝试直接向 API 地址(例如 http://127.0.0.1:5000)发送请求,确认其能正常返回识别结果。
  2. 检查 API 配置:在 pyVideoTrans 的“菜单-翻译设置-自定义语音识别API”中,确认 API 地址、密钥等配置正确无误。
  3. 简化输入测试:尝试使用一个更短、更清晰的音频文件进行测试,以排除音频质量问题导致服务端处理失败。
  4. 查看服务端日志:检查 VibeVoice-ASR 服务端的日志,查看是否有更详细的错误信息。
  5. 更新软件:此错误信息显示代码中存在 UnboundLocalError,这可能是软件的一个已知问题。请确保你使用的是最新版本的 pyVideoTrans(v3.98)。如果已是最新,可以尝试重新下载完整包覆盖。

请查阅相关文档:

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