Skip to main content

Text-To-Speech gbp-webhook plugin

Project description

gbp-webhook-tts

A gbp-webhook plugin to speak the name of a machine or machines when a build is pulled for that machine. See gbp-notifications. The tts in gbp-webhook-tts stands for "text to speech".

Installation

gbp-webhook-tts requires gbp-webhook (which requires gbpcli). You should install gbp-webhook-tts in the same (virtual) environment that you installed those two. For example:

$ pip install --user gbp-webhook-tts

or

$ pipx inject gbpcli gbp-webhook-tts

Usage

You should ensure that gbp-notifications is installed on the Gentoo Build Publisher server for which you want to subscribe and the webhook receiver is configured to receive build_pulled events.

This plugin uses AWS Polly to convert text to to speech. As such it requires you to have an AWS account and an access account to AWS Polly. It uses standard AWS (boto3) environment variables to configure access to AWS and this can be set in the ~/.config/gbp-webhook.conf file. For example:

AWS_ACCESS_KEY_ID=QVCLXRFGNHXLJRSXZQZK
AWS_SECRET_ACCESS_KEY=vRgJyuacKhYPdTEzopGEMxrvWDSSWavXGEROZbdY
AWS_DEFAULT_REGION=us-east-2

On the server

# /etc/gbp-notifications.toml

[recipients]
laptop = { webhook = "https://laptop:5000/webhook|X-Pre-Shared-Key=foobar" }

[subscriptions]
babette = { build_pulled = ["laptop"] }

As gbp-webhook-tts is a plugin for gbp-webhook, it is picked up automatically when that application is run (see the README for details). In order to be picked up it requires a restart of the gbp-webhook service. In systemd this means

$ systemctl restart --user gbp-webhook

Environment variables

Like gbp-webhook, gbp-webhook-tts can be configured via environment variables. If you are using the (preferred) systemd integration, then they will be defined in ~/.config/gbp-webhook.conf. The following environment variables are recognized:

  • GBP_WEBHOOK_TTS_DELAY: If provided, there will be a delay (in seconds) between the time that the notification is received and the machine name is spoken. The default is 0 meaning no delay.

In addition environment variables prefixed with GBP_WEBHOOK_TTS_PHONETIC_ will be used to pass a "phonetic" translation to the text-to-speech engine. This can be used in cases where the spelling and the sound of a machine name differ, or where the TTS engine misspeaks. For example if one has a GBP machine called "kde-desktop" one could use the environment variable setting:

GBP_WEBHOOK_TTS_PHONETIC_KDE_DESKTOP="kay-dee-ee desktop"

Cache

gbp-webhook-tts caches the audio received from the TTS engine. This is used to both speed up the processing and to save on AWS charges. The cached audio is stored in ~/.cache/gbp-webhook/tts/, for example ~/.cache/gbp-webhook/tts/kde-desktop.mp3. These audio files can be safely deleted and will be re-created on demand.

Tips

I use this plugin in concert with gbp-webhook-playsound, with a 0.8-second delay. So I effectively get a chime followed by the name of the machine.

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

gbp_webhook_tts-1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

gbp_webhook_tts-1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file gbp_webhook_tts-1.0.tar.gz.

File metadata

  • Download URL: gbp_webhook_tts-1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for gbp_webhook_tts-1.0.tar.gz
Algorithm Hash digest
SHA256 da1d96ed05d42c0b19964209ddcd17961f0265179ebbdb2a3bf817e1c80f3549
MD5 3ce4b88095d2be79766200468a9d20eb
BLAKE2b-256 fc802d9259d25bf55b48552d77fef93b45b2592018e037a2dd1138549ba34bc0

See more details on using hashes here.

File details

Details for the file gbp_webhook_tts-1.0-py3-none-any.whl.

File metadata

  • Download URL: gbp_webhook_tts-1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for gbp_webhook_tts-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a1e5c5858e4a779629dfc760b2f100ff66d976034a08fe1eeafb2099267afcc
MD5 3548fb0ebf3454f1766741c5c0187917
BLAKE2b-256 2c2503053f219ff1553e57d2373bb2d9ace030f179fabeed7a2438167a3c9a2e

See more details on using hashes here.

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