impress_asr_input_rust/Cargo.toml
impressionyang b5b7930304
Some checks failed
Build Windows GUI / build-windows (push) Has been cancelled
Build Windows GUI / release (push) Has been cancelled
feat: 完成 ASR 识别核心链路实现
- 适配 ort 2.0.0-rc.12 ONNX Runtime API(Session, Value, Shape)
- 实现 log mel fbank 音频特征提取(预加重→分帧→加窗→FFT→Mel滤波器组→对数)
- 实现 cpal 实时音频捕获模块(支持多采样格式: F32/I16/I32/U16)
- 实现 CTC 贪婪解码器和 Vocabulary 词表管理
- 完成 ASR 推理引擎(特征提取→ONNX推理→结果解码完整管线)
- 更新 Tauri 命令和 CLI 工具接入真实 ASR 引擎

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 19:41:11 +08:00

103 lines
2.7 KiB
TOML

[package]
name = "impress_asr_input_rust"
version = "0.1.0"
edition = "2021"
authors = ["Your Name <your.email@example.com>"]
description = "高性能跨平台桌面语音识别输入工具"
license = "MIT"
repository = "https://github.com/your-username/impress_asr_input_rust"
keywords = ["asr", "speech-to-text", "onnx", "audio"]
categories = ["multimedia::audio"]
[features]
default = []
gui = ["dep:tauri", "dep:tauri-plugin-shell", "dep:tauri-plugin-dialog", "dep:tauri-plugin-fs", "dep:global-hotkey", "dep:tauri-build", "dep:cfg_aliases"]
[dependencies]
# Tauri v2 桌面应用框架 (可选,需要 `cargo build --features gui`)
tauri = { version = "2", features = ["tray-icon"], optional = true }
tauri-plugin-shell = { version = "2", optional = true }
tauri-plugin-dialog = { version = "2", optional = true }
tauri-plugin-fs = { version = "2", optional = true }
# 全局快捷键
global-hotkey = { version = "0.6", optional = true }
# ONNX Runtime - 语音识别核心 (使用 2.x rc 版本, 需要手动提供 onnxruntime 库)
ort = { version = "2.0.0-rc.12", default-features = false, features = [] }
cpal = "0.15"
ureq = { version = "2", default-features = false, features = ["tls"] }
# 音频处理
hound = "3.5" # WAV 文件读写
rubato = "0.15" # 高质量音频重采样
realfft = "3.3" # FFT 用于音频特征提取
# 张量处理
ndarray = "0.15"
# 异步运行时
tokio = { version = "1", features = ["full"] }
# 序列化/配置
serde = { version = "1", features = ["derive"] }
serde_json = "1"
toml = "0.8"
# 日志
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# 错误处理
anyhow = "1"
thiserror = "1"
# 其他工具
dirs = "5" # 跨平台目录路径
once_cell = "1" # 懒加载
parking_lot = "0.12" # 高级锁原语
uuid = { version = "1", features = ["v4"] } # 唯一 ID
chrono = { version = "0.4", features = ["serde"] }
# 命令行解析
clap = { version = "4", features = ["derive"] }
[build-dependencies]
tauri-build = { version = "2", features = [], optional = true }
cfg_aliases = { version = "0.2", optional = true }
chrono = "0.4"
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
[[bin]]
name = "impress_asr"
path = "src/bin/cli.rs"
[[bin]]
name = "impress_asr_gui"
path = "src/main.rs"
required-features = ["gui"]
[lib]
name = "impress_asr_lib"
path = "src/lib.rs"
# 性能优化配置
[profile.release]
lto = true
codegen-units = 1
opt-level = 3
strip = true
# 开发环境优化
[profile.dev]
opt-level = 1
# 平台特定配置
[target.'cfg(windows)'.dependencies]
windows = { version = "0.58", features = ["Win32_Media_Audio"] }
[target.'cfg(target_os = "macos")'.dependencies]
coreaudio-sys = "0.2"