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 create a new project in a given target path

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

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.4

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.4
File Size Uploaded Provenance Actions
dtl_text_to_speech-1.0.4.tar.gz 14.3 kB Without provenance Details for dtl_text_to_speech-1.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 34.5 kB

Release files / dtl_text_to_speech-1.0.4.tar.gz

Download URL dtl_text_to_speech-1.0.4.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f59ca7ce62d3cb3c2b685e55e257a064212d1b0aa42d7fb3c0a93b903f7558ee
BLAKE2b-256 checksum
How to use checksums
be72bc9ca0792ee0d47e924fbe276b8dfaba8eedce647b21ab465696be1a662d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

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

Download URL dtl_text_to_speech-1.0.4-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4faca924618649056d6a73cc0dd7afa71fcffc67497e37fba77e107103c0caba
BLAKE2b-256 checksum
How to use checksums
c46367318b6ec92f100392ff3284535f678d28fc4cd98d1fe573fd3c204fb227
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for dtl-text-to-speech 1.0.4

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