Skip to main content

Text-to-Speech (TTS) Simple (by HMCorp)

This repository provides a simple implementation of a Text-to-Speech (TTS) system. It allows users to generate speech audio files (MP3 or WAV) from text files. The project is designed to be lightweight and easy to use.

Features

  • Convert text files into MP3 or WAV audio files
  • Support for multiple languages (over 50 languages supported)
  • Various voice accents for certain languages
  • Cross-platform support for macOS, Windows, and Linux
  • Easy setup and usage

Requirements

  • Python 3.8 or higher
  • pip (Python package manager)
  • FFmpeg (only for WAV file conversion)

Installation

Using pip

  1. Install Python (if not already installed):

    • On macOS:
      brew install python
      
    • On Windows: Download and install Python from python.org. Ensure you check the box to add Python to your PATH during installation.
  2. Install the package:

    pip install tts-simple
    

    This will automatically install all required Python dependencies.

  3. Install FFmpeg for WAV file generation (optional):

    • On macOS:
      brew install ffmpeg
      
    • On Windows: Download and install FFmpeg from FFmpeg.org. Add the FFmpeg binary to your system PATH.

Usage

Command Line Interface

Convert a text file to speech with default settings (English, MP3):

tts-simple input.txt

Specify output file:

tts-simple input.txt output

Convert to WAV format:

tts-simple input.txt -f wav

Use a different language:

tts-simple input.txt -l es  # Spanish

Change voice accent:

tts-simple input.txt -t co.uk  # British English

Use slower speech:

tts-simple input.txt -s

List all available languages and voices:

tts-simple --list

Python API

You can also use the library in your Python code:

from tts_simple import text_to_speech

# Generate speech in English (default)
text_to_speech("input.txt", "output", language="en", output_format="mp3")

# Generate speech in Spanish with slower speed
text_to_speech("input.txt", "output_spanish", language="es", speed=True)

# Generate speech with British accent 
text_to_speech("input.txt", "output_british", tld="co.uk")

Dependencies

The package automatically installs all required Python dependencies, which include:

  • gTTS (Google Text-to-Speech)
  • FFmpeg (is required only if you want to generate WAV files).

Notes

  • The default output format is MP3
  • If no output file is specified, the input filename (with appropriate audio extension) will be used
  • TLD options (voice accents) work best with English language

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

Contact

For questions or support, please contact [apavlenko@hmcorp.fund].

Metadata

Release files for tts-simple 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tts-simple 0.1.2
File Size Uploaded Provenance Actions
tts_simple-0.1.2.tar.gz 5.6 kB Without provenance Details for tts_simple-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tts-simple 0.1.2
File Interpreter ABI Platform Actions
tts_simple-0.1.2-py3-none-any.whl Python 3 none any Details for tts_simple-0.1.2-py3-none-any.whl

Total release size: 11.6 kB

Release files / tts_simple-0.1.2.tar.gz

Download URL tts_simple-0.1.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2284869f4f13c91b498d8febda8ce3e1a4c139f1dabe11dbf73a698bbf668fa7
BLAKE2b-256 checksum
How to use checksums
2714261b384b6028b06299bc9625c62591bc76a3ecb1497101394a5e77aefd4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / tts_simple-0.1.2-py3-none-any.whl

Download URL tts_simple-0.1.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e4b4d6fa6f4cbafc3a5101974fb880912cc3e9ebe389b9a52c86a0cf4495e25
BLAKE2b-256 checksum
How to use checksums
1fa049c89928669cbe7727681a5ac1679fea263c478c8f9333f6d893fcbbe09b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for tts-simple 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page