Pinch real-time speech-to-speech translation plugin for Pipecat
Project description
pipecat-plugins-pinch
Real-time voice translation for Pipecat powered by Pinch.
Installation
pip install pipecat-plugins-pinch
Requires Python ≥ 3.10.
Prerequisites
You need a Pinch API key. Get one at the developers portal.
Set it in your environment:
export PINCH_API_KEY=pk_your_key_here
How it fits into a Pipecat pipeline
PinchTranslatorService is a drop-in FrameProcessor. It sits between your transport's input and output — receiving InputAudioRawFrame from the user and emitting OutputAudioRawFrame (translated speech) and TranscriptionFrame (transcripts) downstream.
transport.input()
│
▼
PinchTranslatorService ← translate en-US → es-ES
│
├─► OutputAudioRawFrame → transport.output() (translated audio)
└─► TranscriptionFrame → your handler (transcripts)
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)
The plugin handles everything internally — calling the Pinch API, managing the translation session, resampling audio, and routing frames — so you don't need to configure anything beyond TranslatorOptions.
Configuration
TranslatorOptions
| Parameter | Type | Default | Description |
|---|---|---|---|
source_language |
str |
required | code for the speaker's language (e.g. "en-US") |
target_language |
str |
required | code for the output language (e.g. "es-ES") |
voice_type |
str |
"clone" |
Voice used for translated output: "clone", "female", or "male" |
PinchTranslatorService
| Parameter | Type | Default | Description |
|---|---|---|---|
options |
TranslatorOptions |
required | Language and voice configuration |
api_key |
str | None |
None |
Pinch API key. Falls back to PINCH_API_KEY env var |
Supported languages
Full list of language codes: supported languages
Transcript frames
The plugin emits standard Pipecat transcript frames for both the original and translated speech. You can consume these in any downstream FrameProcessor.
from pipecat.frames.frames import TranscriptionFrame, InterimTranscriptionFrame
from pipecat.processors.frame_processor import FrameProcessor, FrameDirection
class MyTranscriptHandler(FrameProcessor):
async def process_frame(self, frame, direction):
await super().process_frame(frame, direction)
if isinstance(frame, TranscriptionFrame) and frame.user_id == "":
print(f"Translated: {frame.text}")
await self.push_frame(frame, direction)
Links
License
Apache 2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pipecat_plugins_pinch-0.1.0.tar.gz.
File metadata
- Download URL: pipecat_plugins_pinch-0.1.0.tar.gz
- Upload date:
- Size: 168.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5455f14f96a51987956a18bb6457fc19f556f26cd0cbdaa67a169c1eff994fed
|
|
| MD5 |
8e90038c16de33173d3927f391363e30
|
|
| BLAKE2b-256 |
89cbe35864050ae87ead53f11575a56cec9b14d59cf1a64854b0ccf9f946a754
|
Provenance
The following attestation bundles were made for pipecat_plugins_pinch-0.1.0.tar.gz:
Publisher:
publish.yml on pinch-eng/pipecat-plugins-pinch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pipecat_plugins_pinch-0.1.0.tar.gz -
Subject digest:
5455f14f96a51987956a18bb6457fc19f556f26cd0cbdaa67a169c1eff994fed - Sigstore transparency entry: 1008621573
- Sigstore integration time:
-
Permalink:
pinch-eng/pipecat-plugins-pinch@41cb4bc45422c77682603032079bc91ea58bdadc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/pinch-eng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41cb4bc45422c77682603032079bc91ea58bdadc -
Trigger Event:
release
-
Statement type:
File details
Details for the file pipecat_plugins_pinch-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pipecat_plugins_pinch-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
775ee1ef547a183f77bfbccaf31454400bf13cb1812380487a58bebb8676f7f5
|
|
| MD5 |
130d7fb67281c27abb4bd1e09c7c9f94
|
|
| BLAKE2b-256 |
cfe3fd0b5f1a6224d4271b20a5de8c7c176b3c0dd0d13f3516c9231c0b598952
|
Provenance
The following attestation bundles were made for pipecat_plugins_pinch-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on pinch-eng/pipecat-plugins-pinch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pipecat_plugins_pinch-0.1.0-py3-none-any.whl -
Subject digest:
775ee1ef547a183f77bfbccaf31454400bf13cb1812380487a58bebb8676f7f5 - Sigstore transparency entry: 1008621579
- Sigstore integration time:
-
Permalink:
pinch-eng/pipecat-plugins-pinch@41cb4bc45422c77682603032079bc91ea58bdadc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/pinch-eng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@41cb4bc45422c77682603032079bc91ea58bdadc -
Trigger Event:
release
-
Statement type: