TOOL WIKI · VOICE & REALTIME

Pipecat

Composes realtime voice and multimodal pipelines from model and service components.

Download example files Code + setup + checks in a ZIP
Jump to a section 10 sections

EXAMPLE USE CASE

Observe a generated WebRTC voice pipeline without storing transcripts

A spoken support interface needs capture, turn handling, transcription or playback with explicit media formats and a verifiable outcome.

Input
The official generated bot, provider keys and a TextAudit frame processor.
Expected output
A working voice pipeline with text-frame character-count events.
  • Success check: The scaffold supplies a complete WebRTC bot; the additional processor exposes text-flow events without logging the text.
  • Try a failure: Disconnect or interrupt and verify frames are forwarded without logging raw user text.

Example scope: Actual scaffold integration; add the supplied processor to generated bot.py as instructed. The processor alone is not a complete bot.

Official reference · Pipecat

WHAT IT ISVoice pipeline framework
WHERE IT FITSVoice & realtime
SEE HOW THE SYSTEM FITS TOGETHERSELECT A COMPONENT
mediaprocessoutputtool callresultcontextmeasureUser audioCapture + playbackPipecatVoice pipeline frameworkModels or speechservicesConfigured capabilitiesBusiness toolsServer authorizationState + contextSelected facts and resultsQuality + latencyMeasure the conversation
  1. Obtain microphone consent and handle audio devices and interruption.

  2. Building a configurable pipeline across speech and language services. Coordinate cancellation and buffering across pipeline stages.

  3. Use the speech and reasoning services required by the selected architecture.

  4. Resolve the actual actor and resource before executing actions requested during a call.

  5. Keep confirmed business outcomes separate from transient audio buffers.

    Result or stopping point
  6. Test noisy audio, overlapping speech, tool timeouts, and reconnection.

    Result or stopping point
Pipecat

Building a configurable pipeline across speech and language services. Coordinate cancellation and buffering across pipeline stages.

Follow the arrows, then select a component to inspect its responsibility. On mobile, downward arrows connect the next step; bent arrows identify branches and return paths. Select a destination to jump to that component.

When to consider it

  • Building a configurable pipeline across speech and language services.

A design decision to make

  • Coordinate cancellation and buffering across pipeline stages.

Prerequisites and setup

  • Python 3.11–3.14, the uv package manager, browser microphone access and Deepgram/OpenAI/Cartesia keys.
  • Save turn_logger.py in the generated project, and add the processor to that project’s pipeline as described in the code.
Shell
python3 -m venv .venv
source .venv/bin/activate
pip install uv
uv tool install "pipecat-ai[cli]"
pipecat init quickstart
cd pipecat-quickstart
uv sync

Try a small integration

turn_logger.py

Python · turn_logger.py
from pipecat.frames.frames import TextFrame
from pipecat.processors.frame_processor import FrameProcessor, FrameDirection

class TextAudit(FrameProcessor):
    async def process_frame(self, frame, direction: FrameDirection):
        await super().process_frame(frame, direction)
        if isinstance(frame, TextFrame):
            # Record a count rather than the user's raw transcript.
            print({"event":"text_frame", "characters":len(frame.text)})
        await self.push_frame(frame, direction)

# In the generated bot.py, import TextAudit and place TextAudit()
# after the LLM and before the TTS processor in its Pipeline.
# Keep the generated transport/context aggregators in their original order.

.env.example

Environment · .env.example
DEEPGRAM_API_KEY=YOUR_STT_KEY
OPENAI_API_KEY=YOUR_LLM_KEY
CARTESIA_API_KEY=YOUR_TTS_KEY

Run and check the result

Shell
# Fill the generated .env with the three provider keys.
uv run bot.py
# Open http://localhost:7860/client and select Connect.
  • The scaffold supplies a complete WebRTC bot; the additional processor exposes text-flow events without logging the text.
  • Speak, interrupt, and resume. Verify that stale TTS playback is cleared when a new user turn begins.

Common failures

  • No audio: verify input/output codecs, sample rate, channel count, permission and selected device separately.
  • Handle provider errors and interrupted streams explicitly; do not interpret a disconnected call as a completed business action.

Production decisions

  • Keep permanent credentials on a trusted server; use short-lived session credentials for clients. Define audio/transcript retention and consent.
  • Measure end-of-turn latency, interruption handling, silence, reconnects, tool deadlines and session cost with real microphones and networks.
  • Keep frame backpressure, cancellation, VAD, aggregators and transport shutdown coordinated; a pipeline diagram alone does not implement interruption.

Keep exploring

A realtime voice agent with OpenAIA voice agent with Google Gemini Live

Explore the same layer

OpenAI RealtimeGoogle Gemini LiveLiveKit AgentsDeepgram

Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.