Skip to content

fix(voice): cancel-safe IPC reads, show transcript, robust mic formats - #20

Merged
prasangeet merged 2 commits into
Limbo-corps:mainfrom
Mayu-infinite:mayuri
Jul 28, 2026
Merged

fix(voice): cancel-safe IPC reads, show transcript, robust mic formats#20
prasangeet merged 2 commits into
Limbo-corps:mainfrom
Mayu-infinite:mayuri

Conversation

@Mayu-infinite

Copy link
Copy Markdown
Collaborator

Closes #18

Summary

End-to-end voice pipeline: the Rust client owns all audio (capture, playback,
TTS); the Python runtime transcribes and drives the existing chat pipeline.

Client (Rust)

  • Microphone capture (cpal, all sample formats) → 16-bit WAV (hound).
  • Push-to-talk: v to start/stop; recording shown as RECORDING in the status bar.
  • On voice_end, sends the recorded file path over IPC.
  • Speaks the assistant reply via speech-dispatcher (spd-say); s interrupts.
  • Renders the transcript the runtime echoes back as the user's turn (de-duped
    against typed prompts).

Runtime (Python)

  • VOICE_END carries the recorded path; the bridge transcribes it (Groq Whisper)
    and publishes ChatPipelineStartEvent → same pipeline as a typed prompt.
  • Skips empty / hallucinated transcripts.
  • Stays audio-device agnostic — only reads the file the client produced.

Notable fixes

  • Cancel-safe IPC reads: the client's select! loop cancelled reads every
    frame; a persistent read buffer prevents dropped/corrupted runtime messages.

Verification

  • runtime: pytest 65 passing, ruff clean.
  • client: cargo build / clippy / fmt clean, cargo test passing.
  • CI: client job installs libasound2-dev for the cpal build.

Running it (reviewer notes)

  • Needs speech-dispatcher installed for TTS, and Qdrant/Neo4j (docker compose up -d).
  • Real mic/TTS/playback verified locally; CI covers build + tests.

- ipc: persistent read buffer so select!-cancelled reads don't drop or
  corrupt runtime messages (the main 'not working' cause at 30 FPS).
- client: render the runtime's echoed user text (typed or voice
  transcript) as the user's turn, de-duped against local prompts.
- audio: accept all cpal input sample formats, not just I16/F32.
- runtime: skip empty/hallucinated voice transcripts.
- ui: show voice keybindings (v talk, s stop).
@prasangeet
prasangeet merged commit c0b8a3d into Limbo-corps:main Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(voice): implement end-to-end voice pipeline with IPC integration

2 participants