Skip to main content

Natural Persian Text-to-Speech. One command.

Project description

Persian Speech 🎙️

Natural Persian Text-to-Speech. Zero config, one command.

Built on Mana-Persian-Piper, trained on 114 hours of high-quality Persian speech.
Runs on servers, laptops, Raspberry Pi, and mobile devices. Entirely offline.

Why Persian Speech?

  • Natural voice — Trained on the largest Persian speech dataset (Mana-TTS)
  • Runs anywhere — Linux, Windows, macOS, Raspberry Pi, Android, iOS
  • Edge & mobile ready — ONNX runtime, lightweight model, no GPU needed
  • Offline first — No internet after initial model download
  • Blazing fast — 25x faster than realtime on CPU
  • One commandspeech "سلام" and you're done

Install

pip install persian-speech

Model downloads automatically on first use. That's it.

Usage

Command line:

speech "سلام به همگی"
speech "سلام دنیا" hello.wav

Python:

from persian_speech_runtime import talk
talk("سلام به همگی", "output.wav")

Server:

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

sys.path.insert(0, "src")
from persian_speech_runtime import PiperSpeechEngine
from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs

tts = PiperSpeechEngine()


class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        q = parse_qs(urlparse(self.path).query)
        text = q.get("text", ["سلام به گل های توی خونه"])[0]
        self.send_response(200)
        self.send_header("Content-Type", "audio/wav")
        self.end_headers()
        self.wfile.write(tts.stream(text))


print("http://localhost:8000")
HTTPServer(("0.0.0.0", 8000), Handler).serve_forever()

API

from persian_speech_runtime import PiperSpeechEngine, talk

talk("سلام", "out.wav")              # One-liner

tts = PiperSpeechEngine()
tts.save("سلام", "out.wav")          # Save WAV
tts.stream("سلام")                   # WAV bytes
tts.synthesize("سلام")               # NumPy array

License

MIT — Use it anywhere. Built on Mana-Persian-Piper (MIT) and Mana-TTS (CC0).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

persian_speech-1.1.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persian_speech-1.1.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file persian_speech-1.1.2.tar.gz.

File metadata

  • Download URL: persian_speech-1.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for persian_speech-1.1.2.tar.gz
Algorithm Hash digest
SHA256 7f13fe4b60eeed5aae0fb9865d98da990462176c925247099931c8820e4bcc83
MD5 f788f5afaf61ac5627cd96f596f93c1b
BLAKE2b-256 cab33006baedd846e57b8be1d9b79e9bbf04171562cb95bbeb0fbd753a46cbdb

See more details on using hashes here.

File details

Details for the file persian_speech-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: persian_speech-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for persian_speech-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ede8c6e2ee7cd64ad12e929efddf3632973cd9502ae9d3d2f3a32cf4f796dbc8
MD5 718ea201313bfd2f342f7eb8544d5745
BLAKE2b-256 83777d60aad923d4d04319911fd5801e8b4cc85967a339ee78b1881b735c86ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page