Skip to content

feat(web): add LiveVoiceSession for real-time voice chat (#1345)#1346

Open
crrow wants to merge 2 commits intomainfrom
issue-1345-live-voice
Open

feat(web): add LiveVoiceSession for real-time voice chat (#1345)#1346
crrow wants to merge 2 commits intomainfrom
issue-1345-live-voice

Conversation

@crrow
Copy link
Copy Markdown
Collaborator

@crrow crrow commented Apr 13, 2026

Summary

Add a real-time voice conversation mode (Steps 1-3 of the voice chat design):

  • New LiveVoiceSession component — continuous speech-to-text via Web Speech API (webkitSpeechRecognition), waveform visualizer using AudioContext + AnalyserNode, mute/unmute and end-session controls
  • PiChat integrationliveMode state toggle replaces the top-right VoiceRecorder button with a live voice button; bottom panel overlay shows when active
  • No new npm dependencies — uses built-in Web Speech API, AudioContext, and existing lucide-react icons; skipped LiveKit Agents UI (requires special shadcn registry) in favor of a lightweight hand-written waveform visualizer
  • VoiceRecorder preserved — component file kept as fallback, just removed from PiChat rendering

State machine

IDLE (listening) → SENDING (thinking, waiting for WS response) → back to IDLE. SPEAKING state is a placeholder for Phase 2 (TTS playback).

Type of change

Type Label
New feature enhancement

Component

ui

Closes

Closes #1345

Test plan

  • npm run build passes (tsc + vite)
  • No new npm dependencies added
  • VoiceRecorder.tsx preserved, not deleted
  • All code comments in English

Add a continuous voice conversation mode using the Web Speech API:
- New LiveVoiceSession component with speech recognition, waveform
  visualizer (AudioContext + AnalyserNode), and control bar
- Integrate into PiChat with liveMode toggle replacing VoiceRecorder
- Three states: IDLE (listening), SENDING (thinking), SPEAKING (placeholder)
- Auto-restart recognition on silence, mute/unmute support

Closes #1345

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@crrow crrow added enhancement New feature or request ui User interface changes labels Apr 13, 2026
Rewrite the voice panel UI with ElevenLabs-inspired dark theme:
- AudioVisualizer: larger canvas (400x80), 3px round-cap bars, state-based
  colors (zinc idle, blue hearing, emerald speaking), idle breathing animation
- Voice panel: backdrop-blur-xl, multi-layer dark shadow, h-52 with centered
  flex layout and generous spacing
- Pill-shaped controls: translucent mute (bg-white/5) and red-tinted end button
- Status label: uppercase 11px tracked text
- Interim text: italic muted with min-height to prevent layout jank
- PiChat toggle: active state shows red pulsing dot + "LIVE" pill badge

Closes #1345
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ui User interface changes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

feat(web): real-time voice chat with Live Mode

1 participant