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.
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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dtl_text_to_speech-1.0.1.tar.gz | 13.3 kB | Without provenance | Details for dtl_text_to_speech-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtl_text_to_speech-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for dtl_text_to_speech-1.0.1-py3-none-any.whl |
Total release size: 32.3 kB
Release files / dtl_text_to_speech-1.0.1.tar.gz
| Download URL | dtl_text_to_speech-1.0.1.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
830f2ba90516d7242580fa7e9c5c1031466c8a9e8aa9e3e57c9bec76e4cebe97
|
|
BLAKE2b-256 checksum How to use checksums |
bef7e42f531445cbb63333c8c2b6f62b905fa39e0dc67c8565295017a5cc382f
|
| 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.1-py3-none-any.whl
| Download URL | dtl_text_to_speech-1.0.1-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e7a3285a93b1841504b58e90aafce149c5e9a30a5db0b25fa2578274b2fc2ca
|
|
BLAKE2b-256 checksum How to use checksums |
0490cc40ed7a5c5b14a143314524272eebefb43bde8f68206465a68aee6cc1eb
|
| 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.1
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.