dengjen-piper-rs

Crates

Use Piper TTS models in Rust.

Features

  • Compatibility with all Piper TTS models

  • Support for multiple languages

  • High performance with a pure Rust API (eSpeak NG is vendored and built via CMake/bindgen)

Models

All pretrained models are available at huggingface.co/rhasspy/piper-voices.

Unloading models

Piper has no unload() method because it doesn’t need one: dropping a Piper value releases its ONNX Runtime session, and the native memory backing it, immediately. To unload a model on demand — e.g. to swap voices in a long-running app — hold it behind an Option<Piper> and assign None to it. See examples/unload_model.rs in the repository.

Credits

This project is inspired by sonata, originally created by mush42.

License

Licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later): dengjen-piper-rs links against eSpeak-ng (vendored as a git submodule in crates/espeak-rs-sys), which is GPL-3.0-or-later, so dengjen-piper-rs, dengjen-espeak-rs, and dengjen-espeak-rs-sys are derivative works under the same terms.