Real-time voice translation for LiveKit Agents, powered by Pinch.
Drop this plugin into any LiveKit room and it will:
- Translate spoken audio in real time from one language to another
- Publish the translated audio back into the room as a separate track
- Emit transcripts (original + translated) via a simple callback
pip install livekit-plugins-pinch- Python >= 3.10
- livekit >= 0.12.0
- livekit-agents >= 0.8.0
You need a Pinch API key. Get one at the developers portal.
Set it in your environment:
export PINCH_API_KEY=pk_your_key_hereThat's the only credential this plugin needs. Your LiveKit credentials stay in your own app as usual.
from livekit import rtc
from livekit.plugins.pinch import Translator, TranslatorOptions
async def entrypoint(ctx: JobContext):
await ctx.connect()
translator = Translator(
options=TranslatorOptions(
source_language="en-US",
target_language="es-ES",
voice_type="clone", # "clone" | "female" | "male"
)
)
@translator.on_transcript
def on_transcript(event):
if event.is_final:
print(f"[{event.type}] {event.text}")
await translator.start(ctx.room)| Value | Description |
|---|---|
clone |
Preserves the speaker's original voice identity (default) |
female |
Standard female voice |
male |
Standard male voice |
Full list of language codes: supported languages
Apache 2.0 — see LICENSE for details.