Skip to main content

text-to-speech utility

PTTS wrapper script that transforms dialogues from text to speech using multiple voices and models, and stitches the generated sounds together using PyDub.

Useful for making audiobooks.

See the GitHub page.

References:

PTTS

This script relies on Gradium AI's PTTS for voice generation. See more details at the project's GitHub page.

PyDub

This script uses PyDub to stitch together audio files generated by PTTS. See more details at the project's GitHub page.

Phonon 31m

The Phonon 31m model and names of voices provided by Gradium through the Phonon voices catalog are referenced in the example that comes with this script, as well as in this readme file. The default voice is copied into the example project. The model can be used under the Apache 2.0 license and can be downloaded free of charge from Hugging Face.

Installing

Virtual environment

To avoid dependency conflicts, it is recommended to set up a new virtual environment for the script. For example:

python -m venv /path/to/new/virtual/environment
OR
python3 -m venv /path/to/new/virtual/environment

To activate the environment, run

source /path/to/new/virtual/environment/bin/activate

Downloading the text-to-speech utility

To download and install the package, run

python -m pip install dtl-text-to-speech

Optional Phonon TTS models

Text-to-speech projects can make use of multiple models such as Phonon 31m, Phonon 40m and anything else that may be derived from the two or may be used in the future with PTTS.

These models can be downloaded into local directories that can be referenced from the text-to-speech project.

Example project

Running

Activating the Python environment

This step is necessary for any of the following steps

source /path/to/new/virtual/environment/bin/activate

Listing available voices

The following command can be used to list the voices available in the default voices catalog. This just wraps over the --list-voices functionality of PTTS.

text-to-speech list-catgalog-voices

The following command can be used to list the voices available in a given model. This just wraps over the --list-voices functionality of PTTS.

text-to-speech list-voices [optional-model-path] 

Running the tts transformation on a project directory

Use the following command to run on a project directory

text-to-speech transform <path-to-project-dir>

Take a look at the example-project directory in this repository to understand what a project directory is supposed to contain

Metadata

Release files for dtl-text-to-speech 1.0.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 dtl-text-to-speech 1.0.2
File Size Uploaded Provenance Actions
dtl_text_to_speech-1.0.2.tar.gz 13.3 kB Without provenance Details for dtl_text_to_speech-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dtl-text-to-speech 1.0.2
File Interpreter ABI Platform Actions
dtl_text_to_speech-1.0.2-py3-none-any.whl Python 3 none any Details for dtl_text_to_speech-1.0.2-py3-none-any.whl

Total release size: 32.3 kB

Release files / dtl_text_to_speech-1.0.2.tar.gz

Download URL dtl_text_to_speech-1.0.2.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
07590d3773c50dc63bd3ee90d0014d866178f83beccd51a19503dfad7a2132a9
BLAKE2b-256 checksum
How to use checksums
bff2bc7aa516d4e615145f95f83cf62e5b9b9c9facf001fba61855e701047c78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / dtl_text_to_speech-1.0.2-py3-none-any.whl

Download URL dtl_text_to_speech-1.0.2-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a0f879f6922a8f4fea1db200683e8b524bfaf12b6744161f9fe7f7eeab37547
BLAKE2b-256 checksum
How to use checksums
4553c7bb57f29923e50f57f3bf8520bd9c67d738998beaf131b7c35a90ddf646
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for dtl-text-to-speech 1.0.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