Skip to main content

Overview

PinchTranslatorService provides real-time speech-to-speech translation powered by Pinch. It is a drop-in FrameProcessor that sits between your transport’s input and output: it receives InputAudioRawFrame from the user and emits OutputAudioRawFrame (translated speech) and TranscriptionFrame (transcripts) downstream.

Source Repository

Source code, examples, and issues for the Pinch integration

PyPI Package

The pipecat-plugins-pinch package on PyPI

Pinch

Learn more about Pinch real-time translation

API Keys

Create and manage your Pinch API keys

Installation

This is a community-maintained package distributed separately from pipecat-ai:
pip install pipecat-plugins-pinch
Requires Python >= 3.10.

Prerequisites

Pinch Account Setup

Before using the Pinch translation service, you need:
  1. Pinch Account: Sign up at Pinch
  2. API Key: Get one from the developers portal

Required Environment Variables

  • PINCH_API_KEY: Your Pinch API key for authentication

Configuration

options
TranslatorOptions
required
Language and voice configuration for the translation session. See TranslatorOptions below.
api_key
str
default:"None"
Pinch API key. Falls back to the PINCH_API_KEY environment variable if not provided.

TranslatorOptions

Configuration passed via the options constructor argument using TranslatorOptions(...).
ParameterTypeDefaultDescription
source_languagestrrequiredBCP-47 code for the speaker’s language (e.g. "en-US").
target_languagestrrequiredBCP-47 code for the output language (e.g. "es-ES").
voice_typestr"clone"Voice used for translated output: "clone", "female", or "male".
For the full list of supported language codes, see supported languages.

Usage

from pipecat.pipeline.pipeline import Pipeline
from pipecat.pipeline.runner import PipelineRunner
from pipecat.pipeline.task import PipelineParams, PipelineTask
from pipecat.plugins.pinch import PinchTranslatorService, TranslatorOptions

async def main():
    # Replace with your preferred Pipecat transport (Daily, LiveKit, WebSocket, etc.)
    # transport = DailyTransport(...)

    translator = PinchTranslatorService(
        options=TranslatorOptions(
            source_language="en-US",
            target_language="es-ES",
            voice_type="clone",  # preserves the speaker's voice
        ),
        # api_key="pk_..."  # or set PINCH_API_KEY env var
    )

    pipeline = Pipeline([
        transport.input(),
        translator,
        transport.output(),
    ])

    task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True))
    await PipelineRunner().run(task)

Compatibility

Tested with pipecat-ai >= 0.0.50. Check the source repository for the latest tested version and changelog.