Live mic client
Reference implementation in scripts/live_mic_client.py. Use it to test the server before building your own UI (web, mobile, desktop).
Continuous mode (default)
python scripts/live_mic_client.py --demo --url ws://127.0.0.1:8001/audio
- Mic streams continuously — no Enter per turn
- Server Deepgram endpointing detects when you stop talking
- TTS plays through default output device (
sounddevice) - Type
q+ Enter to exit
Flags
| Flag | Description |
|---|---|
--demo | Smaller mic chunks + low-latency playback (pair with DEMO_MODE=1) |
--turn-based | Press Enter before each recording (legacy) |
--no-duck | Keep sending mic while AI speaks (may cause echo) |
--barge-in-threshold | Mic RMS level to interrupt AI playback (default 1200) |
Audio tips
- Use headphones — speaker output feeds back into the mic and confuses STT
- Client prints input/output device names at startup — verify the correct speaker
- Look for
· Thinking…/· Speaking…and audio byte logs
PCM file testing
For automated tests without a microphone, use scripts/send_test_pcm.py with a raw 16 kHz mono PCM file (see samples/README.md).