Aucune description

Efren Yevale Varela ec45b8cd94 Updated documentation il y a 1 mois
docs ec45b8cd94 Updated documentation il y a 1 mois
scripts cb05dce80b Added assistant layer il y a 1 mois
src e254cc310d Added additional engine il y a 1 mois
tests e254cc310d Added additional engine il y a 1 mois
.gitignore 57aaafd88f Updated git ignore il y a 1 mois
.python-version a0adf9ae9d Initial commit il y a 1 mois
AGENTS.md ec45b8cd94 Updated documentation il y a 1 mois
LICENSE.md ee33e71b49 Updated documentation il y a 1 mois
README.md ec45b8cd94 Updated documentation il y a 1 mois
config.example.toml e254cc310d Added additional engine il y a 1 mois
pyproject.toml e254cc310d Added additional engine il y a 1 mois
uv.lock e254cc310d Added additional engine il y a 1 mois

README.md

STT Daemon

An always-on speech-to-text daemon that listens to a PulseAudio/PipeWire source, detects voice activity, and transcribes utterances to Spanish/English text, with a separate voice-assistant layer for commands and chat on top.

Overview

  • Capture audio continuously from PulseAudio/PipeWire sources
  • Preserve the start of speech with a pre-roll (ring) buffer, so the first phoneme is never cut when voice detection fires
  • Segment utterances with configurable silence thresholds
  • Transcribe each utterance with Faster-Whisper (multilingual: Spanish, English, or auto-detect)
  • Output to stdout (human-readable) and/or JSONL files
  • Run non-blocking with worker threads so audio keeps flowing during transcription
  • Act on speech through the separate stt-assistant process (modes, commands, chat, tools, audit)

Architecture

Audio Source (PulseAudio)
    ↓
ParecCapture / SoundDeviceCapture
    ↓
Pre-roll Ring Buffer (VAD lookback)
    ↓
WebRTC-VAD (voice activity detection)
    ↓
FrameSegmenter (utterance boundaries)
    ↓
Queue (segment_queue)
    ↓
Faster-Whisper (transcription)
    ↓
TranscriptSink (stdout + transcripts/YYYY-MM-DD.jsonl) + EventPublisher
    ↓  publish-only UNIX socket ($XDG_RUNTIME_DIR/stt-daemon.sock)
stt-assistant  (subscribes; owns modes, command buffer, chat, LLM, tools)
    ↓  control socket ($XDG_RUNTIME_DIR/stt-assistant.sock)
stt-tui (viewer) / stt-ctl (hotkeys)              audit/YYYY-MM-DD.jsonl ←┘

The daemon never accepts input: it only transcribes and publishes. Everything stateful lives in the assistant, a separate process (see docs/ASSISTANT.md).

Prerequisites

System packages

  • PulseAudio or PipeWire-Pulse: pactl, parec command-line tools

    • On Ubuntu/Debian: apt-get install pulseaudio-utils or apt-get install pipewire pipewire-pulse
    • On Fedora: dnf install pulseaudio-utils
    • On macOS: Install via Homebrew (though PulseAudio is Linux-first; the sounddevice backend is recommended on macOS)
  • FFmpeg (optional, used by Faster-Whisper for format conversion)

    • On Ubuntu/Debian: apt-get install ffmpeg

Python

Installation

Clone the repo and install with uv:

# From the repo root (wherever you cloned it)
cd /path/to/STT-TTS

# Sync dependencies (installs into .venv)
uv sync

# (Optional) If you want to use the sounddevice backend (requires portaudio):
uv sync --extra portaudio

Quick Start

Copy the example config and edit as needed:

cp config.example.toml config.toml

Then launch the whole system with one command:

uv run stt-daemon up --with-tui

That supervises the daemon, the assistant, and the TUI together; quitting the TUI stops everything cleanly. The manual flow is the same three steps without the supervisor:

uv run stt-daemon setup       # create the virtual sink (interactive picker)
uv run stt-daemon run         # start listening and transcribing
uv run stt-daemon clear --yes # tear down the sink when done

See docs/CLI.md for every subcommand and docs/CONFIGURATION.md for the config reference.

Documentation

Testing

Run the full suite with no audio hardware or live LLM required:

uv run pytest -v

See docs/DEVELOPMENT.md for what the tests cover.

References

License

This project is ISC-licensed. See LICENSE.md.


Made with ❤️ for Efren. Questions? Open an issue or reach out.