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.1.tar.gz (8.0 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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gbp_webhook_tts-1.0.1.tar.gz
  • Upload date:
  • Size: 8.0 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.1.tar.gz
Algorithm Hash digest
SHA256 ef20af906f8cf304324cef714ccf481fc83db427faa0ddb635b1b95057594ff0
MD5 5a1a83794ecdf6f83efc320fc5c97456
BLAKE2b-256 8539d7f246979f09b442be7b4dd8663f119965f60998caf7eafc4523dffb5e0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gbp_webhook_tts-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e44ba50d29d9e0e33f96ea032d30b8d4638b219301b21d2f88f47c60dbf4974
MD5 2939390f6d5edface911652b677f2b51
BLAKE2b-256 a396faa9b127f6b8acdcfb14d04c58b111a636c49641382c546493833cc9982c

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