Metadata-Version: 2.4
Name: pydengjen
Version: 3.0.3
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Summary: Python bindings for the dengjen-tts speech synthesis engine
Keywords: tts,text-to-speech,speech-synthesis,onnx,piper
Home-Page: https://github.com/ZirekHQ/dengjen
License-Expression: GPL-3.0-or-later
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Issues, https://github.com/ZirekHQ/dengjen/issues
Project-URL: Repository, https://github.com/ZirekHQ/dengjen

# dengjen-tts-python

Python bindings to `dengjen-tts` using `pyo3`. Published to PyPI as `pydengjen`.

Install, voice download and a runnable example:
<https://zirekhq.github.io/dengjen/next/start-python.html>. The example source is
[`examples/python/synthesize.py`](https://github.com/ZirekHQ/dengjen/blob/main/examples/python/synthesize.py).

## Speech recognition

Wheels for Linux x86_64, Windows x64 and macOS arm64 include an offline recognizer. It needs a
model directory (`model.int8.onnx` and `tokens.txt`) and the SHA-256 of the model file:

```python
import pydengjen

with pydengjen.Recognizer(model_dir, model_sha256) as recognizer:
    text = recognizer.recognize(samples, 16000)  # mono floats in [-1, 1]
```

Failures raise `pydengjen.SttError`, a `DengjenException` whose `.code` is the `libdengjen-stt`
error code. Other wheels, and builds without the `stt` feature, have no `Recognizer`.


