TOOL WIKI · VOICE & REALTIME
Pipecat
Composes realtime voice and multimodal pipelines from model and service components.
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.
Obtain microphone consent and handle audio devices and interruption.
mediaTo 02 · PipecatBuilding a configurable pipeline across speech and language services. Coordinate cancellation and buffering across pipeline stages.
tool callTo 04 · Business toolscontextTo 05 · State + contextmeasureTo 06 · Quality + latencyUse the speech and reasoning services required by the selected architecture.
outputBack to 02 · PipecatResolve the actual actor and resource before executing actions requested during a call.
resultBack to 02 · PipecatKeep confirmed business outcomes separate from transient audio buffers.
Result or stopping pointTest noisy audio, overlapping speech, tool timeouts, and reconnection.
Result or stopping point
Building a configurable pipeline across speech and language services. Coordinate cancellation and buffering across pipeline stages.
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.
python3 -m venv .venv
source .venv/bin/activate
pip install uv
uv tool install "pipecat-ai[cli]"
pipecat init quickstart
cd pipecat-quickstart
uv syncTry a small integration
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
DEEPGRAM_API_KEY=YOUR_STT_KEY
OPENAI_API_KEY=YOUR_LLM_KEY
CARTESIA_API_KEY=YOUR_TTS_KEYRun and check the result
# 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
Explore the same layer
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.