Skip to main content

Dimits is a Python library that provides an easy-to-use interface to the Piper text-to-speech (TTS) system. It utilizes the powerful Piper TTS engine, which is optimized for Raspberry Pi 4, to generate high-quality synthesized speech.

Project description

Dimits - Python Bindings for Piper TTS

Dimits is a Python library that provides an easy-to-use interface to the Piper text-to-speech (TTS) system. It utilizes the powerful Piper TTS engine, which is optimized for Raspberry Pi 4, to generate high-quality synthesized speech.

Features

  • Simple Python bindings for Piper TTS
  • Support for multiple languages and voices
  • Compatible with Raspberry Pi 3/4 and desktop Linux systems

Installation 📥

You can install Dimits via pip:

pip install dimits

This will automatically install the necessary dependencies

Quick Start 🏃🏻‍♀️

Here's a simple example of using Dimits to synthesize speech:

from dimits import Dimits

# Initialize Dimits with the desired voice model
dt = Dimits("en_US-amy-low")

# Convert text to audio and play it using the aplay engine
dt.text_2_speech("Hello World", engine="aplay")

Voices 🔊

Dimits supports all the voices available in the Piper TTS system. To use a specific voice, simply provide corresponding .onnx file namepo initializing the Dimits class.

For a list of available voices and their download links, refer to the Piper TTS repository.

Usage 📃

Initializing Dimits

To use Dimits, first create an instance of the Dimits class, providing the path to the desired voice model:

from dimits import Dimits

dt = Dimits("en_US-amy-low")

Synthesizing Speech

To synthesize speech and play on the go, simply call the text_2_speech method, providing the text to be synthesized and the desired engine:

dt.text_2_speech("This is a test.",engine='aplay')

on other hand to synthesize speech and save it to the file, call text_2_audio_file finction providing file_name dir and format

dt.text_2_audio_file("Hello World", "hello_world", "/path/to/output/directory/", format="wav")

Changing Voices

To change the voice used for synthesis, create a new instance of the Dimits class with the desired voice model:

# dt = Dimits("en_US-amy-low")
dt = Dimits("en_US-danny-low")

TODO 📝

  • Implement windows compatible executible to run the voice models
  • Support for multiple audio player engine
  • Benchmark
  • Documentation

License 🪪

This project is licensed under the MIT License.

Acknowledgements

Dimits is based on the work of the Piper project by Rhasspy, and is made possible by the contributions of its developers and the open source community. Without their hard work and dedication, this project would not be possible.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dimits-0.0.31a0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dimits-0.0.31a0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file dimits-0.0.31a0.tar.gz.

File metadata

  • Download URL: dimits-0.0.31a0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for dimits-0.0.31a0.tar.gz
Algorithm Hash digest
SHA256 fc99be32f2e99f4dc84d52668f30566a62d910cf31dc8e75c395d78264cc2451
MD5 f3970629c1885bd6eabafbdb727ca8c5
BLAKE2b-256 19dcfeffa40cbdf88ea29b961d0de547d108b7b027574edf25ff535233e5e4dc

See more details on using hashes here.

File details

Details for the file dimits-0.0.31a0-py3-none-any.whl.

File metadata

  • Download URL: dimits-0.0.31a0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.11 Linux/6.8.0-1021-azure

File hashes

Hashes for dimits-0.0.31a0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb4e089aeead06d1acac8bea316be91db59463e815ec7c225a628f0be76312d
MD5 dfe09c60de1b40a1d63460a60eea6821
BLAKE2b-256 a39952cf4266ed3b2b2beb8181daa2f1ad3d655977148d1282349e9f6200f23a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page