# Voice Desk

Talk to my coding agent instead of typing: one shortcut starts listening, whisper transcribes on the Mac, opencode answers in the project's own voice session, and the reply is spoken as it streams. Common Mac commands run instantly and “work on <project>” switches repository.

**Status:** Live · Projects · 2026

- **Local checkout:** `/Users/simon/Developer/voice-desk`
- **Where it runs:** Menu bar app started at login by launchd; ffmpeg captures audio; whisper model lives in ~/Developer/models/whisper-cpp.
- **Note:** Local Mac app · runs on my Mac

## Stack

Swift/AppKit menu bar, Carbon global hotkey, ffmpeg (AVFoundation capture), whisper.cpp large-v3-turbo, opencode CLI, macOS say

## Start here

- `Sources/AppDelegate.swift` — state machine, hotkeys, project switching, agent turns
- `Sources/Recorder.swift` — ffmpeg capture with silencedetect auto-stop
- `Sources/Transcriber.swift` — whisper-cli wrapper and transcript cleanup
- `Sources/Brain.swift` — opencode run --format json, per-project session, streaming text
- `Sources/Speaker.swift` — sentence-buffered say playback and markdown cleanup
- `Sources/Commands.swift` — instant Mac commands and project matching
- `Sources/HUD.swift` — non-activating bottom-centre card
- `install.sh` — build, ad-hoc sign, install app and LaunchAgent

## Commands

- **Rebuild and install:** `cd ~/Developer/voice-desk && ./install.sh`
- **Check dependencies and microphones:** `~/'Applications/Voice Desk.app'/Contents/MacOS/VoiceDesk --doctor`
- **Transcribe a wav:** `~/Applications/'Voice Desk.app'/Contents/MacOS/VoiceDesk --transcribe file.wav`
- **Ask the agent without speech:** `~/Applications/'Voice Desk.app'/Contents/MacOS/VoiceDesk --ask "question"`
- **Test a local command:** `~/Applications/'Voice Desk.app'/Contents/MacOS/VoiceDesk --command "open Safari"`

## Deploy and where it runs

- Local macOS app: ~/Applications/Voice Desk.app plus LaunchAgent com.navonsimon.voicedesk, installed by install.sh; no server or container.

## Current state

Running. About 3s for a cold reply on deepseek-flash. Talk is ⌃⌥V because ⌃⌥Space is macOS 'next input source'; ⌃⌥X stops everything. Voice sessions are kept per project in ~/.config/voice-desk/state.json.

## Watch out

- ⌃⌥Space is the system 'next input source' shortcut, so the app uses ⌃⌥V.
- A rebuild changes the ad-hoc signature, so macOS may ask for microphone access once more.
- micIndex must match the ffmpeg device list; connecting AirPods changes it.
- One opencode process per turn; replies are instructed to be short because they are read aloud.
- Silence auto-stop only arms after speech; a silent press records until maxSeconds or a second press.

## Secrets — locations only, never print values

- No secrets in the app; it uses the local opencode login in ~/.local/share/opencode/auth.json.

## Tags

Voice, whisper.cpp, opencode, macOS, Hands-free

---

Brief generated 2026-11-08 from `~/Developer/my-projects/context/`. Canonical URL: https://projects.navonsimon.com/context/voice-desk.md
