Metadata-Version: 2.4
Name: persian-speech
Version: 1.0.0
Summary: Natural Persian Text-to-Speech. One command.
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: piper-tts>=1.4.0
Requires-Dist: numpy

# Persian Speech Runtime 🗣️

**Natural Persian Text-to-Speech. One command.**

[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A lightweight, production-ready runtime for converting Persian text into natural-sounding speech. Built on the efficient [Piper TTS](https://github.com/rhasspy/piper) engine, it's designed to be simple to install and use.

## 🎧 Output Sample

**"سلام به همگی!"** (Hello everyone!)

🔊 [Listen to the output sample](output.mp3)

## ✨ Features

- **🎯 Natural Persian Voice:** Generates clear and natural-sounding Persian speech.
- **🐍 Simple API:** Use it in your Python projects with just one line of code.
- **🖥️ Multi-Interface:** Run it via CLI, as a local web server, or directly in Python.
- **⚡ Fast & Lightweight:** Optimized for runtime efficiency with minimal dependencies.
- **📦 Easy Installation:** Get started with a single `pip` command.

## 🚀 Install

```bash
pip install persian-speech
python install.py
```

The `install.py` script will automatically download and set up the necessary TTS model for you.

> **💡 Tip:** After installation, you can clean up temporary files:
>
> ```powershell
> rm -r -force src/persian_speech_runtime/__pycache__, outputs, models/__pycache__ 2>$null
> mkdir outputs 2>$null
> ```

## 🛠️ Usage

### Command Line

Generate speech directly from your terminal:

```bash
speech "سلام به همگی" output.wav
```

### Python API

Integrate TTS into your Python applications with a single function:

```python
from persian_speech_runtime import talk

talk("سلام به همگی")
```

### Local Web Server

Run a simple HTTP server to access the TTS engine via REST API:

```bash
python server.py
# http://localhost:8000/tts?text=سلام
```

The server will return the generated audio file.

## 📄 License

Distributed under the MIT License. See the [LICENSE](License) file for more information.
