feat: add real-time recording visualization
Real-Time Recording Visualization
Adds live visual feedback during voice recording to improve UX and help users understand what's happening during recording sessions.
What This Does
Shows real-time recording feedback with:
- Audio level meter with color-coded RMS visualization (0-100%)
- Recording duration vs. maximum time
- Speech detection status (detected/not detected)
- State indicators: WAITING (yellow) → ACTIVE (green) → SILENCE (blue)
- Silence progress bar showing accumulation toward threshold
- Minimum duration progress before silence can stop recording
Example
╭─────────────────────────────── 🎤 Recording... ───────────────────────────────╮
│ │
│ Duration: 3.2s / 120.0s │
│ State: ACTIVE │
│ Speech: ✓ Detected │
│ Audio Level: ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░ 72% │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
Why This Matters
Users previously had no visual feedback during recording, leading to:
- Uncertainty about whether the mic was working
- Confusion about when to speak (only feedback was an audio beep)
- Difficulty diagnosing audio issues
- No visibility into the VAD state machine
This PR solves these issues by making the recording process transparent and providing clear visual cues.
Implementation
New module (voice_mode/recording_visualization.py):
RecordingVisualizerclass with thread-safe updates- Live display at 10 FPS using the Rich library
- Zero overhead when disabled
Integration (voice_mode/tools/converse.py):
- Real-time RMS calculation in audio callback
- State tracking (WAITING → ACTIVE → SILENCE)
- Proper cleanup on completion and errors
Configuration:
- Enabled by default for better UX
- Can be disabled via
VOICEMODE_RECORDING_VISUALIZATION=false
Dependencies:
- Added
rich>=13.0.0for terminal UI
Testing
Manual test script included (test_visualization.py) that simulates:
- Waiting for speech phase
- Active recording with speech
- Silence accumulation until threshold
Documentation
Comprehensive guide added at docs/features/recording-visualization.md:
- Feature overview and benefits
- Configuration options
- Technical details
- Troubleshooting common issues
Changes
pyproject.toml- Added rich dependencyvoice_mode/config.py- AddedRECORDING_VISUALIZATION_ENABLEDsettingvoice_mode/recording_visualization.py- New visualization modulevoice_mode/tools/converse.py- Integrated visualizer into recording flowdocs/features/recording-visualization.md- Feature documentationtest_visualization.py- Manual test script
@mbailey this is a mostly complete draft, I want to do some more extensive testing on it, but mainly wanted to get my idea down for some feedback 👍🏻 cheers!
Great idea for UX improvement! One architectural question to consider:
Where can this be displayed when VoiceMode runs as an MCP server?
When VoiceMode runs via voicemode serve (HTTP transport) or as an MCP server via stdio, there's no terminal attached to display Rich visualizations to. The MCP protocol communicates via JSON-RPC, not terminal output.
A few possibilities:
- Only works in direct terminal mode - the visualization shows when running
voicemode conversedirectly, but not when running as an MCP server - Server logs - could output to stderr/logs, but users wouldn't see it in real-time
- MCP tool response - could return visualization state as part of the response, but that's not real-time
- Separate status endpoint - the HTTP server could expose a
/statusWebSocket that clients poll for real-time recording state
The honest assessment is: this visualization is designed for terminal use and doesn't translate well to the MCP server model. It's really a feature for when you're running VoiceMode directly in a terminal.
That said, it would still be valuable for:
- Users running
voicemode conversedirectly from terminal - Debugging and testing audio issues
- Development workflows
What are your thoughts on the intended use case?
Thanks Cody — love the UX intent here. The blocker is that VoiceMode's MCP server talks JSON-RPC over stdio (server.py runs mcp.run(transport="stdio")), so a Rich Console/Live writing to stdout would corrupt that channel and break converse for the default install. Could you (a) route the Console to stderr and only render when attached to a real TTY (mirror server.py's is_mcp_mode/isatty check), and (b) make it opt-in / auto-off when not a TTY instead of default-on? Also please rebase (it's currently conflicting), move test_visualization.py under tests/manual/, and add a CHANGELOG entry. Happy to iterate — it's a nice feature once it can't touch the protocol stream.
Thanks Cody — love the UX intent here. The blocker is that VoiceMode's MCP server talks JSON-RPC over stdio (server.py runs mcp.run(transport="stdio")), so a Rich Console/Live writing to stdout would corrupt that channel and break converse for the default install. Could you (a) route the Console to stderr and only render when attached to a real TTY (mirror server.py's is_mcp_mode/isatty check), and (b) make it opt-in / auto-off when not a TTY instead of default-on? Also please rebase (it's currently conflicting), move test_visualization.py under tests/manual/, and add a CHANGELOG entry. Happy to iterate — it's a nice feature once it can't touch the protocol stream.