|
| 1 | +# qol |
| 2 | + |
| 3 | +Voice-to-text dictation overlay. Hold a hotkey, talk, release — your cleaned-up |
| 4 | +words appear in whatever app has focus. Powered by |
| 5 | +[Aavaaz](../Aavaaz/aavaaz/) for streaming transcription and an LLM polish pass |
| 6 | +for filler removal, punctuation, and per-app tone. |
| 7 | + |
| 8 | +`qol` (қол) means "voice" in Kazakh — a sibling name to Aavaaz ("voice" in Hindi). |
| 9 | + |
| 10 | +## Architecture |
| 11 | + |
| 12 | +``` |
| 13 | +┌──────────────────────────────────────────────────┐ |
| 14 | +│ qol (Tauri desktop app) │ |
| 15 | +│ │ |
| 16 | +│ global-shortcut ──► push-to-talk │ |
| 17 | +│ cpal ──► 16 kHz mono PCM │ |
| 18 | +│ tokio-tungstenite──► ws://localhost:9090 │ ── Aavaaz/WhisperLive ──► transcript |
| 19 | +│ active-win ──► focused app context │ |
| 20 | +│ Claude API ──► polish (tone, punctuation) │ |
| 21 | +│ enigo ──► inject text into focused app│ |
| 22 | +│ │ |
| 23 | +│ webview ──► settings UI (Vite + TS) │ |
| 24 | +└──────────────────────────────────────────────────┘ |
| 25 | +``` |
| 26 | + |
| 27 | +## Layout |
| 28 | + |
| 29 | +| Path | Purpose | |
| 30 | +|---|---| |
| 31 | +| `src-tauri/Cargo.toml` | Rust deps (tauri, cpal, tokio-tungstenite, enigo, reqwest) | |
| 32 | +| `src-tauri/src/main.rs` | App entry, hotkey wiring, Tauri commands | |
| 33 | +| `src-tauri/src/audio.rs` | Mic capture → 16 kHz mono f32 frames | |
| 34 | +| `src-tauri/src/transport.rs` | WebSocket session to Aavaaz/WhisperLive | |
| 35 | +| `src-tauri/src/session.rs` | Lifecycle: audio → transport → polish → inject | |
| 36 | +| `src-tauri/src/inject.rs` | Keystroke injection (enigo) + active-window probe | |
| 37 | +| `src-tauri/src/polish.rs` | Claude API call for transcript cleanup | |
| 38 | +| `src-tauri/src/config.rs` | JSON config in `~/.config/qol/config.json` | |
| 39 | +| `index.html` + `src/` | Vite settings UI | |
| 40 | + |
| 41 | +## Prerequisites |
| 42 | + |
| 43 | +- Rust 1.77+ (`rustup toolchain install stable`) |
| 44 | +- Node 20+ (`pnpm` or `npm`) |
| 45 | +- A running Aavaaz instance at `ws://localhost:9090` |
| 46 | +- An `ANTHROPIC_API_KEY` env var if you want the polish pass (optional — raw transcripts inject fine without it) |
| 47 | + |
| 48 | +### Fedora-specific system deps |
| 49 | + |
| 50 | +```bash |
| 51 | +sudo dnf install -y \ |
| 52 | + webkit2gtk4.1-devel \ |
| 53 | + openssl-devel \ |
| 54 | + curl wget file \ |
| 55 | + libappindicator-gtk3-devel \ |
| 56 | + librsvg2-devel \ |
| 57 | + gtk3-devel \ |
| 58 | + alsa-lib-devel \ |
| 59 | + libxdo-devel |
| 60 | +``` |
| 61 | + |
| 62 | +`libxdo-devel` is needed by `enigo` on X11. On Wayland, you may also need a |
| 63 | +`ydotool` daemon for reliable injection (GNOME Wayland blocks synthetic input |
| 64 | +otherwise). |
| 65 | + |
| 66 | +## Run |
| 67 | + |
| 68 | +```bash |
| 69 | +# in one terminal — start Aavaaz with a model that fits your GPU |
| 70 | +cd ../Aavaaz/aavaaz |
| 71 | +source .venv/bin/activate |
| 72 | +aavaaz serve --model distil-large-v3 |
| 73 | + |
| 74 | +# in another — build and run qol |
| 75 | +cd ../../qol |
| 76 | +npm install |
| 77 | +npm run tauri dev |
| 78 | +``` |
| 79 | + |
| 80 | +Then press your hotkey (default `Super+Space`), speak, and release. |
| 81 | + |
| 82 | +## Settings |
| 83 | + |
| 84 | +Edit via the settings window (open from system tray), or directly at |
| 85 | +`~/.config/qol/config.json`: |
| 86 | + |
| 87 | +```json |
| 88 | +{ |
| 89 | + "aavaaz_url": "ws://localhost:9090", |
| 90 | + "model": "distil-large-v3", |
| 91 | + "language": "en", |
| 92 | + "hotkey": "Super+Space", |
| 93 | + "polish": { |
| 94 | + "enabled": true, |
| 95 | + "provider": "anthropic", |
| 96 | + "model": "claude-haiku-4-5-20251001", |
| 97 | + "api_key_env": "ANTHROPIC_API_KEY", |
| 98 | + "per_app_tone": true |
| 99 | + }, |
| 100 | + "hotwords": ["Aavaaz", "qol", "WhisperLive"], |
| 101 | + "inject_method": "type" |
| 102 | +} |
| 103 | +``` |
| 104 | + |
| 105 | +## Tests & CI |
| 106 | + |
| 107 | +```bash |
| 108 | +cd src-tauri |
| 109 | +cargo test # unit tests (config round-trip, hotkey parser) |
| 110 | +cargo clippy --all-targets -- -D warnings |
| 111 | +cargo fmt -- --check |
| 112 | +``` |
| 113 | + |
| 114 | +CI runs the above on **Ubuntu, macOS, and Windows** for every push and PR — see |
| 115 | +[.github/workflows/ci.yml](.github/workflows/ci.yml). |
| 116 | + |
| 117 | +Hardware-bound paths (audio capture, keystroke injection) and network-bound |
| 118 | +paths (WebSocket session, Claude polish) aren't unit-tested yet; integration |
| 119 | +tests with a fake Aavaaz endpoint and a virtual audio device are a TODO. |
| 120 | + |
| 121 | +## Status |
| 122 | + |
| 123 | +This is a scaffold. Working / stubbed: |
| 124 | + |
| 125 | +- [x] Mic capture with cheap linear resampling to 16 kHz |
| 126 | +- [x] WebSocket session with Aavaaz/WhisperLive handshake |
| 127 | +- [x] LLM polish pass with per-app tone hint |
| 128 | +- [x] enigo-based text injection |
| 129 | +- [x] Global hotkey via `tauri-plugin-global-shortcut` |
| 130 | +- [x] Settings UI |
| 131 | +- [ ] Proper resampling (replace linear with `rubato`) |
| 132 | +- [ ] Wayland injection fallback (`ydotool` IPC) |
| 133 | +- [ ] Streaming injection (type as segments arrive vs. only at release) |
| 134 | +- [ ] Per-app tone profiles configurable in UI |
| 135 | +- [ ] Voice commands ("new line", "scratch that") |
| 136 | +- [ ] Local-only polish via llama.cpp |
| 137 | +- [ ] Tray menu (pause, open settings, quit) |
| 138 | + |
| 139 | +## License |
| 140 | + |
| 141 | +MPL-2.0 |
0 commit comments