Speech Flow is a real-time conversational voice interface and audio stream visualizer. It interprets rolling speech buffers from microphone input, dynamically renders audio frequency spectrums and token confidence streams, dispatches structured conversational utterances to Adrastea, and narrates cognitive decisions aloud via low-latency Text-to-Speech (TTS).
Tip
Voice Cockpit: Speech Flow acts as the multimodal voice layer for autonomous agent architectures like Adrastea, enabling zero-lag verbal directives, live WPM telemetry, and hands-free desktop/mobile control over local networks and Tailscale.
- Architecture & Interaction Loop
- Core Features
- System Comparison: Speech Flow vs Native Voice
- Quick Start
- CLI Reference
- Mobile & Tailscale Access
- Contributing
- Show Your Support
- License
sequenceDiagram
autonumber
actor User as User (Voice / Mic)
participant SF as Speech Flow (Web Cockpit)
participant Buffer as SpeechBuffer Visualizer
participant IPC as IPC Channel (127.0.0.1:8765)
participant Adrastea as Adrastea (System Alpha & Beta)
participant TTS as TTS Engine (Audio Playback)
User->>SF: Speaks into microphone
SF->>Buffer: Stream live PCM audio & interim word tokens
Buffer->>SF: Render dynamic frequency waveform & confidence tags
alt Silence Threshold Reached (1.5s) OR User Clicks "Send"
SF->>IPC: Transmit SIG_CONVERSATION payload
IPC->>Adrastea: Ingest text tokens & conversational intent
Adrastea->>Adrastea: Cognitive evaluation & tool dispatch
Adrastea-->>IPC: Return response envelope + action badge
IPC-->>SF: Deliver formatted response payload
SF->>SF: Render response bubble with state badge
SF->>TTS: Synthesize spoken response
TTS-->>User: Plays response aloud through speakers
end
- π Real-Time Waveform & Buffer Visualizer:
- Live Web Audio API frequency analysis pulsing smoothly with microphone input gain.
- Interactive rolling word token display distinguishing between active speech hypotheses and committed word tokens.
- Continuous telemetry: Real-time Words-Per-Minute (WPM), RMS audio volume, and token counts.
- β‘ Bidirectional IPC with Adrastea:
- Connects directly to Adrastea's low-latency TCP socket (
127.0.0.1:8765). - Supports conversational directives (e.g. "Adrastea, check system health", "Wake up", "Go to sleep", "Run diagnostics").
- Receives rich decision envelopes containing action badges, execution statuses, and voice responses.
- Connects directly to Adrastea's low-latency TCP socket (
- π Dual-Engine Text-To-Speech (TTS):
- Browser Web Speech API: Client-side, zero-lag voice playback for desktop and mobile browsers.
- Native Windows SAPI Engine: High-fidelity local voice synthesis via
win32com.clientfor headless or desktop automation.
- π± Mobile & Headless Responsive:
- Full-screen responsive viewport designed for smartphones (iOS Safari & Android Chrome).
- Effortless secure remote access across mesh networks (e.g., Tailscale).
| Capability | Standard Web Speech | Speech Flow Cockpit |
|---|---|---|
| Streaming Hypothesis Visualization | β No | β Real-time token highlighting |
| Live WPM & Audio Telemetry | β No | β Real-time WPM + Volume Meter |
| Agent IPC Integration | β No | β
Native SIG_CONVERSATION TCP socket |
| Mobile Mesh Access (Tailscale) | β Difficult | β Built-in responsive web serving |
| Dual TTS Synthesis (Client & Local SAPI) | β Client only | β Hybrid browser + native fallback |
- Python 3.10+
- Ensure Adrastea is running in keep-alive mode:
cd C:\Users\LukeH\Adrastea python -m adrastea.cli keepalive
cd C:\Users\LukeH\speech-flow
python -m speech_flow.cli serve --port 7860- Local Machine: Open
http://127.0.0.1:7860in Chrome, Edge, or Safari. - Click "Start Listening" and grant microphone permissions.
- Speak naturally; watch your words stream into the visualizer and hear Adrastea's answers spoken back.
python -m speech_flow.cli serve --host 0.0.0.0 --port 7860Simulate a full round-trip voice query without opening a browser:
python -m speech_flow.cli test --text "Adrastea, report your current operational status."Access the full voice cockpit from your smartphone over Tailscale:
- Ensure Tailscale is running on both host PC and mobile phone.
- Launch Speech Flow bound to
0.0.0.0:python -m speech_flow.cli serve --host 0.0.0.0 --port 7860
- Navigate to
http://<your-tailscale-ip>:7860on mobile Safari or Chrome.
Contributions to audio DSP algorithms, noise-cancellation filtering, and UI visualizations are welcomed!
- Fork the repo (
gh repo fork holman57/speech-flow). - Create a feature branch (
git checkout -b feat/vad-silence-detector). - Commit your changes (
git commit -m 'feat: implement WebAudio VAD energy detector'). - Push and open a Pull Request.
See CONTRIBUTING.md for full development standards.
If you enjoy Speech Flow, please give it a β Star and π΄ Fork the repo to help other developers build voice-enabled AI agents!
This project is licensed under the MIT License.