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:

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.3.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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: persian_speech-1.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 817de08998be9ca8ed03058bc0d2447ac1e97454de7136716d2a5fd1c6ab3cb6
MD5 24fe3533cba586e0e5f221154611d8f0
BLAKE2b-256 9e8b8171c7f76fff7ae369445982a4364b870a0e9e1b524351830a03063ae210

See more details on using hashes here.

File details

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

File metadata

  • Download URL: persian_speech-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 066d6749ca7505bda0f750fb0017a4ff8806f70556ec6c30abe48cea55328597
MD5 d88ba42081613b9a99830386b953e451
BLAKE2b-256 ac0b8258cf897d070149c287aee36c18c9d69fc8bdabfe496a1dbf962cee443b

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