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.30a0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

dimits-0.0.30a0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dimits-0.0.30a0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Linux/6.5.0-1018-azure

File hashes

Hashes for dimits-0.0.30a0.tar.gz
Algorithm Hash digest
SHA256 f1d2d3b8c8e73d2cb55c0f385aa0099a3181ed91cf1a046619ba4cbea5c18511
MD5 dce98c45a5e42d1e815b72070109e88d
BLAKE2b-256 047406dec3c5513f932db8ee4a442e6f403eae4ff1fd8d695ad4c60e79ba997f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dimits-0.0.30a0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.14 Linux/6.5.0-1018-azure

File hashes

Hashes for dimits-0.0.30a0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0a391cf98115954e4e0d409d6d7e72a030eca55985cc5a26fc0e8735b6086a
MD5 655bc549dfc4d6854351a7c1072264ea
BLAKE2b-256 1ac360ea1c6054f28611d6ccb2588194ab649cddaa54fe97ce67d577420586b3

See more details on using hashes here.

Supported by

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