Skip to main content

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.

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. Before the first release, configure PyPI's pending trusted publisher for the risajef/mkdocs-piper-tts repository and the publish-pypi.yml workflow.

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

mkdocs_piper_tts-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_piper_tts-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_piper_tts-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_piper_tts-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mkdocs_piper_tts-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14f22adc9c960212b91405a269fab28f30b661f2316cedbc2c1b1a89462d571c
MD5 3fe8d5fb05488e15090980bf0ae11ca3
BLAKE2b-256 97eabe6fdf6b6600fe26d8943b3e2792dfa9fa0ae0e474e64772eaef0304fd8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_piper_tts-0.1.0.tar.gz:

Publisher: publish-pypi.yml on risajef/mkdocs-piper-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_piper_tts-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_piper_tts-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d365db1d785a88be43b32fa0afcd296e8e6fd0595eb05768f0c1abbd2608b859
MD5 40e2dd8c99d274b7d58008433beee0db
BLAKE2b-256 304ce533e7663810a014aa50baf92a22104801da0f7ea156f0a501bfbe7ae369

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_piper_tts-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on risajef/mkdocs-piper-tts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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