Skip to content

feat: 启动阶段支持按通道降级,并补充 Windows 健康检查脚本#5

Open
Ser4nu11EN7 wants to merge 5 commits intoIm-Sue:mainfrom
Ser4nu11EN7:fix/startup-degradation-and-windows-tooling
Open

feat: 启动阶段支持按通道降级,并补充 Windows 健康检查脚本#5
Ser4nu11EN7 wants to merge 5 commits intoIm-Sue:mainfrom
Ser4nu11EN7:fix/startup-degradation-and-windows-tooling

Conversation

@Ser4nu11EN7
Copy link
Contributor

变更说明

具体内容

1. 启动阶段支持按通道降级

之前无论是音频播放器、系统音频捕获、字幕窗口,还是火山引擎连接,只要其中某一步失败,整个程序都会直接退出。

修改后:

  • Channel 1 启动失败时,只关闭 Channel 1 相关资源
  • Channel 2 启动失败时,只关闭 Channel 2 相关资源
  • 只要仍有至少一个通道可用,程序就继续运行
  • 只有当两个通道都不可用时,才统一报错退出

避免“部分依赖缺失时整个程序完全不可用”的情况。

例如:

  • 没有 FFmpeg 时,Channel 1 会降级关闭
  • 系统音频捕获失败时,Channel 2 会降级关闭
  • 火山引擎某个通道连接失败时,也只影响对应通道

2. 清理降级场景下的资源释放逻辑

为了支持按通道关闭,补充了对应资源的清理逻辑,避免某个通道关闭后,后续事件循环或停止流程还继续访问已经失效的对象。

3. 新增 Windows 健康检查脚本

增加了 scripts/healthcheck.ps1,用于 Windows 环境下的运行前检查,主要包括:

  • .venv 是否存在
  • 依赖是否完整
  • config.yaml 是否存在且可解析
  • 火山引擎配置是否填写
  • Protobuf 导入是否正常
  • 音频设备是否可枚举
  • FFmpeg 是否可用

如果 FFmpeg 不可用,脚本会给出提示,说明启用 zh_to_en 语音输出时运行阶段会进行降级关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant