Always-on Yoruba speech pipeline. Speak Yoruba into your mic and the system either: captions - what you said and prints a corrected, properly accented version (default), or answers - you as a conversational voice assistant and speaks the reply aloud.
# Yoruba Live Voice
Always-on **Yoruba** speech pipeline. Speak Yoruba into your mic and the system
either:
- **captions** what you said and prints a corrected, properly accented version
(default), or
- **answers** you as a conversational voice assistant and speaks the reply aloud
(`--chat`).
Whisper (STT) and Silero (VAD) run **locally**. Grok (xAI) does the
correction/conversation and YarnGPT does the Yoruba speech — both are cloud
APIs keyed from `.env`.
```
mic ─► Silero VAD ─► faster-whisper (STT) ─► Grok (correct | respond) ─► YarnGPT (TTS) ─► speaker
local local cloud cloud
```
## What it does
`live_caption.py` runs five concurrent stages so the mic is never deaf — slow
cloud calls never block capture or live decoding:
1. **PortAudio callback** pushes 512-sample frames into a queue.
2. **Streaming Silero VAD** finds speech start/end, emitting live partial
snapshots and finalized segments.
3. **faster-whisper** decodes each segment, printing partials live (`\r`) and
finalizing on a pause.
4. The **Grok** stage either **corrects** the caption (default refiner) or
**responds** to it as a conversational brain (`--chat`).
5. **YarnGPT** reads the correction/reply aloud (`--speak` / `--chat`).
Speaking is **half-duplex**: the mic mutes during playback so the spoken audio
isn't transcribed back into a feedback loop.
## Repo layout
```
live_caption.py # the always-on app (all five stages)
benchmark.py # transformers fp32 vs faster-whisper fp16 on one utterance
download.py # pull the base Whisper Yoruba model from Hugging Face
test.py # standalone record-until-silence STT loop (faster-whisper)
services/
brain/ # Grok conversational brain (--chat) — responds
refine/ # Grok caption corrector (default) — corrects
tts/ # YarnGPT Yoruba text-to-speech
env_loader.py # loads repo-root .env into …