Metadata-Version: 2.4
Name: livekit-plugins-pinch
Version: 0.1.0
Summary: LiveKit Agents plugin for Pinch real-time speech-to-speech translation
Project-URL: Homepage, https://www.startpinch.com
Project-URL: Documentation, https://www.startpinch.com/docs
Project-URL: Repository, https://github.com/pinch-eng/livekit-plugins-pinch
Project-URL: Bug Tracker, https://github.com/pinch-eng/livekit-plugins-pinch/issues
Author-email: Pinch <support@startpinch.com>
License: Apache-2.0
License-File: LICENSE
Keywords: agents,livekit,pinch,real-time,speech-to-speech,translation
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: livekit-agents>=0.8.0
Requires-Dist: livekit>=0.12.0
Requires-Dist: pinch-sdk>=0.1.1
Description-Content-Type: text/markdown

# livekit-plugins-pinch

Real-time voice translation for [LiveKit Agents](https://github.com/livekit/agents), powered by [Pinch](https://www.startpinch.com).

---

## What it does

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

---

## Installation

```bash
pip install livekit-plugins-pinch
```

---

## Configuration

You need a **Pinch API key**. Get one at the [developers portal](https://portal.startpinch.com/dashboard/developers).

Set it in your environment:

```bash
export PINCH_API_KEY=pk_your_key_here
```

That's the only credential this plugin needs. Your LiveKit credentials stay in your own app as usual.

---

## Usage

```python
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)
```

---

## Voice types

| Value | Description |
|-------|-------------|
| `clone` | Preserves the speaker's original voice identity (default) |
| `female` | Standard female voice |
| `male` | Standard male voice |

---

## Supported languages

Full list of language codes: [supported languages](https://www.startpinch.com/docs/supported-languages)

---

## License

Apache 2.0 — see [LICENSE](./LICENSE) for details.
