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.5.tar.gz (11.1 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.5-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyt2s-0.0.5.tar.gz
  • Upload date:
  • Size: 11.1 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.5.tar.gz
Algorithm Hash digest
SHA256 5216332fb076a3ade7ad67952a8b4fd8fb7079773aeb0adfa3c174a3b17faed3
MD5 d65da0ab2de588bebddc9197ea579939
BLAKE2b-256 4648130ee6b0c89c8a91044136d1b5995ef59f871a7903e775510a8fa505043e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyt2s-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0588945a66071ab8b55e88c40f48dd45f9f27e38f9697cc28fefea7d0eff1349
MD5 17b87a52a88c9a7fdf6edd9024e84ab8
BLAKE2b-256 bd7391effadaeccff03fcbdb52562985e0e8cc4e21e2c926899d99cc36889f84

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