Skip to main content

Python library you need for text to speech.

Project description

pyt2s

The Python Text-to-Speech library you didn’t know you needed (or maybe you did).

⚠️ Toy project alert: This is experimental and fun, not production-grade.

Downloads

🎯 What is pyt2s

A lightweight Python wrapper for generating speech from text using various online TTS services—no heavy model downloads, no complex setup. Just plug, play, and talk.

Inspired by Chris Phillips's php tts library library, pyt2s was born out of frustration:

“Why is there no Python TTS library that’s simple, supports multiple voices (including both genders), and doesn’t ask me to download 20GB of models?”

Now there is.

🧠 Supported TTS Service

pyt2s taps into several online services to give you voice variety:

  • Acapela
  • Cepstral
  • Oddcast
  • Stream Elements
  • Stream Labs
  • Voice Forge

🚀 Installation

Option 1: From Source

git clone https://github.com/yourusername/pyt2s.git
cd pyt2s
pip install -r requirements.txt
pip install -e .

Option 2: From PyPI

pip install pyt2s

🛠️ Usage

Here’s how to convert text to speech and save it as an MP3:

from pyt2s.services import stream_elements

# Default Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.')

# Custom Voice
data = stream_elements.requestTTS('Lorem Ipsum is simply dummy text.', stream_elements.Voice.Russell)

with open('output.mp3', '+wb') as file:
    file.write(data)

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

pyt2s-0.0.6.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

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

pyt2s-0.0.6-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file pyt2s-0.0.6.tar.gz.

File metadata

  • Download URL: pyt2s-0.0.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.14.2

File hashes

Hashes for pyt2s-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f0540aec1c533804240b8536d95b6dc12933f431915a337e3e44f497938775ed
MD5 af542a95b97b97a8ed7ea048a337732b
BLAKE2b-256 670d2fdf60145bb4f11fc74a33bff28b2b309d5e08bb7b1b3ce92103e516e003

See more details on using hashes here.

File details

Details for the file pyt2s-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: pyt2s-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.14.2

File hashes

Hashes for pyt2s-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 51c586cd5ffbc800d2cfb7057532627a9eae79396abd7fbff6261d448d36840e
MD5 c8ce8a156c76410fc2df7bf4bf180235
BLAKE2b-256 3412452b65d928aa818e5623d7ef4fc44e5b6a2c2abe2e051d50c2a10259b255

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