Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Speech Flow

Python 3.10+ Web Audio API Adrastea IPC License: MIT PRs Welcome GitHub Stars

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.


Table of Contents


Architecture & Interaction Loop

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
Loading

Core Features

  • 🌊 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.
  • πŸ”Š 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.client for 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).

System Comparison

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

Quick Start

Prerequisites

  1. Python 3.10+
  2. Ensure Adrastea is running in keep-alive mode:
    cd C:\Users\LukeH\Adrastea
    python -m adrastea.cli keepalive

1. Launch Speech Flow Server

cd C:\Users\LukeH\speech-flow
python -m speech_flow.cli serve --port 7860

2. Access the Voice Cockpit

  • Local Machine: Open http://127.0.0.1:7860 in 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.

CLI Reference

Serve Web Interface

python -m speech_flow.cli serve --host 0.0.0.0 --port 7860

Headless Verification Test

Simulate a full round-trip voice query without opening a browser:

python -m speech_flow.cli test --text "Adrastea, report your current operational status."

Mobile & Tailscale Access

Access the full voice cockpit from your smartphone over Tailscale:

  1. Ensure Tailscale is running on both host PC and mobile phone.
  2. Launch Speech Flow bound to 0.0.0.0:
    python -m speech_flow.cli serve --host 0.0.0.0 --port 7860
  3. Navigate to http://<your-tailscale-ip>:7860 on mobile Safari or Chrome.

Contributing

Contributions to audio DSP algorithms, noise-cancellation filtering, and UI visualizations are welcomed!

  1. Fork the repo (gh repo fork holman57/speech-flow).
  2. Create a feature branch (git checkout -b feat/vad-silence-detector).
  3. Commit your changes (git commit -m 'feat: implement WebAudio VAD energy detector').
  4. Push and open a Pull Request.

See CONTRIBUTING.md for full development standards.


Show Your Support

If you enjoy Speech Flow, please give it a ⭐ Star and 🍴 Fork the repo to help other developers build voice-enabled AI agents!


License

This project is licensed under the MIT License.

About

Real-time speech orchestration and audio stream visualizer with live rolling word buffers, bidirectional IPC integration with Adrastea, and low-latency TTS voice playback.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages