Metadata-Version: 2.5
Name: voicelab-sdk
Version: 0.1.0
Summary: Official Python SDK for the VoiceLab API
Author: VoiceLab
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT 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: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Requires-Dist: websockets<16,>=14
Provides-Extra: dev
Requires-Dist: build<2,>=1.2; extra == 'dev'
Requires-Dist: mypy<2,>=1.17; extra == 'dev'
Requires-Dist: pip-audit<3,>=2.9; extra == 'dev'
Requires-Dist: pytest-cov<8,>=6.2; extra == 'dev'
Requires-Dist: pytest<10,>=9.0.3; extra == 'dev'
Requires-Dist: ruff<1,>=0.12; extra == 'dev'
Description-Content-Type: text/markdown

[![PyPI](https://img.shields.io/pypi/v/voicelab-sdk)](https://pypi.org/project/voicelab-sdk/)
[![Python](https://img.shields.io/pypi/pyversions/voicelab-sdk)](https://pypi.org/project/voicelab-sdk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

## Installation

```bash
pip install voicelab-sdk
```

## Initialization

```python
import os

from voicelab import VoiceLab

client = VoiceLab(api_key=os.environ["VOICELAB_API_KEY"])
```

## Generate speech

```python
speech = client.tts.synthesize(
    text="Hello from VoiceLab.",
    language="en",
    voice_id="voice_01J9NEUTRAL0000000000000001",
)

with open("speech.wav", "wb") as audio_file:
    audio_file.write(speech.audio)
```

## Transcribe audio

```python
result = client.stt.transcribe(audio="meeting.mp3", language="en")

if result.transcript is not None:
    print(result.transcript)
```

## Stream speech

```python
with client.realtime.connect_text_to_speech() as stream:
    stream.synthesize(
        text="This audio arrives as PCM chunks.",
        language="en",
        voice_id="voice_01J9NEUTRAL0000000000000001",
    )
    for message in stream:
        if isinstance(message, bytes):
            playback_queue.put(message)
```
