VoicePipeline (voice/pipeline.py)

SynapseKit · src/synapsekit/voice/pipeline.py · python · Apache-2.0
voice, Voice / Speech

Real‑time voice pipeline combining VAD, STT, LLM, and TTS for conversational AI.

# Source: https://github.com/SynapseKit/SynapseKit | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""
Real-time VoicePipeline.

Pipeline flow::

    microphone → VAD → STT → LLM → TTS → speaker

VAD gates transcription so silence is never forwarded to STT providers,
keeping cloud costs low and latency sharp.

Interruption handling stops TTS playback within ``interrupt_threshold_ms``
of continuous speech onset, then opens a fresh STT session for the new
utterance.
"""

from __future__ import annotations

import asyncio
import contextlib
import sys
from collections.abc import AsyncIterator, Awaitable, Callable
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
    from ..memor

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key