MkDocs plugin for generating and serving Piper text-to-speech page audio
Project description
mkdocs-piper-tts
An MkDocs plugin that generates Piper text-to-speech audio for pages and adds
an HTML audio control through the piper_tts_button template helper.
Install
pip install mkdocs-piper-tts
For CUDA synthesis, install the CUDA extra on a compatible CUDA 12 system:
pip install 'mkdocs-piper-tts[cuda]'
For TensorRT synthesis support, install:
pip install 'mkdocs-piper-tts[tensorrt]'
The plugin invokes ffmpeg to encode MP3 files, so ffmpeg must be available
on PATH when generating audio.
Piper Version Policy
This package intentionally pins piper-tts==1.2.0. That release is MIT
licensed and is compatible with this package's MIT license. Do not upgrade
Piper without first reviewing the license of the target release and its
runtime dependencies.
Configure
Store Piper .onnx models and their JSON configuration files outside the
published documentation source, then enable the plugin in mkdocs.yml:
plugins:
- piper-tts:
model_dir: models/piper-tts
asset_dir: assets/piper-tts
audio_dir: audio
use_cuda: true
batch_size: 2
languages:
en:
model: en_US-amy-medium.onnx
label: Listen
de:
model: de_DE-thorsten-medium.onnx
label: Vorlesen
Set lang in a page's front matter. The plugin caches generated MP3 files and
sidecar metadata under <docs_dir>/<asset_dir>/<audio_dir>. Cached files are
reused when both page source and plugin code are unchanged.
Set generate_audio: false for cache-only builds. In this mode, missing or
stale audio fails the build instead of initializing Piper; use it in CI after
restoring a verified audio cache artifact.
Render the control in an MkDocs template with:
{{ piper_tts_button(page) }}
Releases
Tags named v* build and publish a wheel and source distribution with PyPI
trusted publishing. For each release, update the version in pyproject.toml,
commit it, and push a matching tag such as v0.2.0. PyPI versions are
immutable, so never reuse a published version or tag.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_piper_tts-0.1.1.tar.gz.
File metadata
- Download URL: mkdocs_piper_tts-0.1.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74ae59200678a584924e7fea2465d341ef1827e9b5c5ecfda484710a8f8c8012
|
|
| MD5 |
c832674f924c8066a080e8b1589eb215
|
|
| BLAKE2b-256 |
97b251189b4ea5da9df33256bb70851d3152c5ef9ad9864e69efea5c58aa7304
|
Provenance
The following attestation bundles were made for mkdocs_piper_tts-0.1.1.tar.gz:
Publisher:
publish-pypi.yml on risajef/mkdocs-piper-tts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_piper_tts-0.1.1.tar.gz -
Subject digest:
74ae59200678a584924e7fea2465d341ef1827e9b5c5ecfda484710a8f8c8012 - Sigstore transparency entry: 2180141722
- Sigstore integration time:
-
Permalink:
risajef/mkdocs-piper-tts@0757488bd2ad4357951b236df5959ed12b676691 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/risajef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0757488bd2ad4357951b236df5959ed12b676691 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_piper_tts-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mkdocs_piper_tts-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c03f6dbd6945311923d76209a9494e494f43ec737c07da6c4e8c21f5b598ed7
|
|
| MD5 |
ae211f3876114a7e9528f5afbe0fb201
|
|
| BLAKE2b-256 |
147ca63beec00e83af106a5b86495ed8e57c032a2ad8d417b181cff857116a28
|
Provenance
The following attestation bundles were made for mkdocs_piper_tts-0.1.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on risajef/mkdocs-piper-tts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_piper_tts-0.1.1-py3-none-any.whl -
Subject digest:
8c03f6dbd6945311923d76209a9494e494f43ec737c07da6c4e8c21f5b598ed7 - Sigstore transparency entry: 2180141800
- Sigstore integration time:
-
Permalink:
risajef/mkdocs-piper-tts@0757488bd2ad4357951b236df5959ed12b676691 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/risajef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0757488bd2ad4357951b236df5959ed12b676691 -
Trigger Event:
push
-
Statement type: