长按说话,松手即输 —— 离线 · 极速 · 跨平台

VoiceSnap 是一款离线语音转文字工具。按住快捷键说话,松开即识别并输入文字到任意应用。无需联网,无需注册,开箱即用。
voicesnap.exe.dmg,拖入 Applications,首次启动需授予辅助功能权限# 环境要求
# - Go 1.22+
# - Node.js 20+
# - CGO 编译器 (Windows: LLVM MinGW UCRT, macOS: Xcode Command Line Tools)
# 克隆
git clone https://github.com/vorojar/VoiceSnap.git
cd VoiceSnap/VoiceSnapGo
# 安装前端依赖
cd frontend && npm install && cd ..
# 开发模式
wails3 dev
# 生产构建 (Windows)
windres voicesnap.rc -o voicesnap.syso
CGO_ENABLED=1 go build -ldflags "-H windowsgui -s -w" -o voicesnap.exe .
# 生产构建 (macOS)
CGO_ENABLED=1 go build -o voicesnap .
Windows:
| 文件 | 大小 | 说明 |
|---|---|---|
voicesnap.exe |
~15 MB | 主程序 |
onnxruntime.dll |
~15 MB | ONNX Runtime |
sherpa-onnx-c-api.dll |
~4 MB | sherpa-onnx C API |
sherpa-onnx-cxx-api.dll |
~248 KB | sherpa-onnx C++ API |
models/sensevoice/ |
~200 MB | 语音模型(首次自动下载) |
macOS:
| 文件 | 大小 | 说明 |
|---|---|---|
VoiceSnap.app |
~15 MB | 应用包(含 dylib) |
models/sensevoice/ |
~200 MB | 语音模型(首次自动下载) |
VoiceSnapGo/
├── main.go # 入口:单实例 + Wails 启动
├── app.go # 编排:热键 → 录音 → 识别 → 粘贴
├── internal/
│ ├── audio/ # malgo 录音 + 设备枚举
│ ├── engine/ # sherpa-onnx 推理
│ ├── hotkey/ # 全局热键轮询
│ ├── input/ # 剪贴板 + 粘贴 + 剪贴板保护
│ ├── config/ # JSON 配置
│ ├── history/ # 识别历史(JSON 持久化)
│ ├── textproc/ # 中英混合文本后处理
│ ├── sound/ # 录音音效(合成 WAV)
│ ├── overlay/ # 浮动指示器(Win32 GDI+ / macOS AppKit)
│ └── ...
├── services/ # Wails 服务(前端绑定)
└── frontend/ # Svelte + Vite
├── src/components/ # 设置窗口 + 指示器
└── src/lib/ # stores + i18n
| 组件 | 技术 |
|---|---|
| 桌面框架 | Wails v3 |
| 前端 | Svelte 5 + Vite + TypeScript |
| 音频录制 | malgo (miniaudio) |
| 语音识别 | sherpa-onnx (SenseVoice) |
| 全局热键 | Windows: GetAsyncKeyState 轮询 / macOS: NSEvent + CGEventSource |
| 文字输入 | Windows: 剪贴板 + SendInput / macOS: 剪贴板 + CGEvent |
| 浮动指示器 | Windows: GDI+ Layered Window / macOS: AppKit + CoreGraphics |
| 音效 | 程序合成 WAV + 平台原生播放 |
MIT License