功能: - Tauri v2 GUI 应用 - 系统托盘支持 - 日志输出到文件 - 带时间戳的版本号 - 前端资源嵌入 修复: - 前端路径使用相对路径 - 移除 devUrl 配置 - 窗口置顶设置
100 lines
2.5 KiB
TOML
100 lines
2.5 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"]
|
|
onnx = ["dep:onnxruntime-ng"]
|
|
|
|
[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 - 语音识别核心 (可选)
|
|
onnxruntime-ng = { version = "1.16.1", optional = true, features = ["disable-sys-build-script"] }
|
|
|
|
# 音频处理
|
|
hound = "3.5" # WAV 文件读写
|
|
|
|
# 张量处理
|
|
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"
|