Skip to content

pyttsgen is a lightweight, developer-friendly Python library for generating high-quality speech using Microsoft’s Edge TTS voices. It offers seamless text-to-speech generation via CLI, scripting, or a Streamlit-powered web UI — all from a single, unified toolkit.

License

Notifications You must be signed in to change notification settings

Reprompts/pyttsgen

Repository files navigation

pyttsgen

pyttsgen is a plug-and-play TTS (Text-to-Speech) generator for Python. It supports:

  • 🔧 Python scripting
  • 🖥️ CLI access
  • 🌐 Streamlit UI

🔌 Installation

pip install pyttsgen
🧪 Usage


1. 🧑‍💻 Python Scripting
python

from pyttsgen import TTS

tts = TTS()
tts.speak_to_file("Hello from Python!", "hello.mp3")
audio_bytes = tts.speak_to_bytes("In-memory audio!")
base64_audio = tts.speak_to_base64("Base64 audio for web!")


2. 💻 CLI

pyttsgen "This is CLI-based speech" --voice en-GB-RyanNeural --output speech.mp3
List all voices

pyttsgen --list-voices
Show usage help

pyttsgen


3. 🌐 UI (Streamlit)

Typing "app" in the CLI
Opens a browser UI to enter text and download audio.

About

pyttsgen is a lightweight, developer-friendly Python library for generating high-quality speech using Microsoft’s Edge TTS voices. It offers seamless text-to-speech generation via CLI, scripting, or a Streamlit-powered web UI — all from a single, unified toolkit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages