斩龙electron重构及功能优化#1
Open
cuijiawei123 wants to merge 6 commits into
Open
Conversation
架构重构: - 新增 Electron 前端 (electron/), 替代原 PySide6 GUI - 新增 Python WebSocket 后端 (backend.py), 前后端通过 ws://127.0.0.1:9877 通信 - 前端 SPA: Macros Dashboard + Logs + About 三页面, Catppuccin 暗色主题 - 支持中英文双语 (i18n.js) 配置管理: - 新增 utils/config_manager.py — 单例 ConfigManager, 统一路径/配置/线程安全/变更回调 - 兼容 PyInstaller 打包路径 语音识别优化: - 新增 utils/dialect_variants.py — 方言变体自动生成 (平翘舌/前后鼻音/l-n/h-f 等) - 新增 utils/fuzzy_matcher.py — 变体后缀还原 + 编辑距离兜底匹配 - 新增 utils/threshold_tuner.py — 动态阈值自动调优, 连续误触检测+惩罚+恢复 - voice_listener.py: int8 量化模型 + VAD 门控 + AGC 调优 (max_gain 15→6) - keywords_invoker.txt: 10→50 行 (含方言变体+独立阈值) - 触发统计持久化到跨平台用户数据目录 (Win/Mac/Linux) 清理: - 删除 utils/donation_window.py (已被 AboutWindow 替代) - requirements.txt 从 126 个包精简至 ~30 个 - 新增 .gitignore, zhanlong.spec 打包配置 - 新增 silero_vad.onnx VAD 模型 (629KB) - 新增 docs/zipformer-research.md 模型调研报告
- 新增 backend.spec: PyInstaller 打包 backend.py (int8模型, 排除PySide6) - 修复 main.js: 跨平台exe路径, 生产模式cwd, Windows taskkill进程清理 - 重写 preload.js: WebSocket自动重连(1s间隔/30次), 连接状态通知 - 配置 electron-builder: NSIS+portable双产物, extraResources引入后端 - 修复 backend.py: 移除自动pip install(打包后无pip) - 更新 封装exe.md: 完整双步打包文档 - 新增 build.bat/build.sh: 一键打包脚本(Win/Mac/Linux)
- 关于页面:紧凑化布局,flex居中,700px窗口内无需滚动 - 图标:从16/32px升级为16/32/48/64/128/256px多尺寸ico - 新增app_icon.png (512x512) 供macOS/Linux使用 - package.json: macOS/Linux改用png图标
- 龙头+霓虹蓝光环,黑底,契合斩龙主题 - ico: 从1024px高清源缩放,含16/32/48/64/128/256六个尺寸 - png: 512x512 供macOS/Linux使用
- 顶栏logo: Material adb图标 → 龙头图片 - 关于页面logo: 同步替换 - 新增 electron/public/logo.png
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
将斩龙从 PySide6 桌面应用重构为 Electron + Python 后端架构,同时大幅优化语音识别准确率,补完跨平台打包流程。
主要变更
🏗️ 架构重构
electron/),替代原 PySide6 GUIbackend.py),通过ws://127.0.0.1:9877通信i18n.js)🎤 语音识别优化
dialect_variants.py)— 自动生成平翘舌、前后鼻音、l/n、h/f 等变体fuzzy_matcher.py)— 变体后缀还原 + 编辑距离兜底threshold_tuner.py)— 连续误触自动提高阈值,长期无误触自动恢复⚙️ 工程改进
config_manager.py)— 单例模式,线程安全,变更回调通知%APPDATA%/Zhanlong/(Win)/~/Library/Application Support/Zhanlong/(Mac)requirements.txt:126 个包 → ~30 个donation_window.py.gitignore📦 打包流程
backend.spec— PyInstaller 打包后端(int8 模型,排除 PySide6)electron-builder— NSIS 安装包 + 便携版main.js生产模式路径(跨平台 exe 名,正确的 cwd)build.bat/build.sh一键打包脚本📄 文档
README.md— 项目介绍、架构图、快速开始、技术栈说明docs/zipformer-research.md— Zipformer 模型调研报告文件统计