__ _ _ _ _ __
| _| |__ _ __| |__ __ _ ___| | _____| ||_ |
| || '_ \| '__| '_ \ / _` |/ __| |/ / _ \ __| |
| || |_) | | | | | | (_| | (__| < __/ |_| |
| ||_.__/|_| |_| |_|\__,_|\___|_|\_\___|\__| |
|__| |__|
This script bridges WeeChat messages to your system's speech-dispatcher (spd-say).
While most TTS scripts suffer from crashes, threading lockups, or audio lag, this project was built for Fedora 43 / KDE 6 (but works everywhere) to solve those issues. It supports Piper TTS, Festival, and Espeak out of the box.
- ⚡ Zero Latency Queue
- No waiting. Messages are read the instant they arrive via a dedicated thread.
- 🧠 Smart Sequencing
- No Repetition: If
UserAsends 3 messages, it says: "UserA says. Hello. How are you." (It doesn't repeat the name). - Turn-Taking: If
UserBinterrupts, it switches speakers instantly.
- No Repetition: If
- 🗣️ Nickname Humanizer
MuddyMacey→ "Muddy Macey"brhacket42→ "brhacket 42"Shmoo→ "shmoo" (Forces phonetic reading vs spelling letters).
- 🔇 Smart Filtering
- Focus Mode: Only reads the chat you are actively looking at.
- Background Alerts: Plays a sound and says "New message in #channel" if you are pinged elsewhere.
- 💾 Persistent Config
- Remembers your volume, sound preferences, and active channels after restart.
You need WeeChat (with Python support) and Speech Dispatcher.
Fedora:
sudo dnf install weechat weechat-python speech-dispatcher-utilsUbuntu/Debian:
sudo apt install weechat weechat-python speech-dispatchermkdir -p ~/.local/share/weechat/python/
# Assumes you are inside the repo folder
cp tts_weechat.py ~/.local/share/weechat/python/Run these commands inside WeeChat:
/plugin load python
/python load tts_weechat.py
/script autoload tts_weechat.py
Note: By default, TTS is OFF to prevent spam. Enable it using /listento.
| Command | Usage | Description |
|---|---|---|
/listento |
/listento |
Lock TTS to current chat. (Enables Audio) |
/listento auto |
Follow Focus. Reads whatever chat you click on. | |
/listento off |
Disable TTS. | |
/shh |
/shh |
Mute Voice. (Keeps background notification sounds). |
/shh all |
Mute Everything (Silence). | |
/shh disable |
Unmute. |
| Command | Usage | Description |
|---|---|---|
/setsound |
/setsound [type] |
Choose BG alert sound: chime, bell, alert, off. |
/ignoreme |
/ignoreme [on/off] |
Read my own messages? (Default: off = Read them). |
/iam |
/iam [nick] |
Manually set your nickname if auto-detection fails. |
/ttsdbg |
/ttsdbg [on/off] |
View debug logs in chat window. |
To get modern AI voices on Linux (Fedora/KDE):
- Install Pied (via Flatpak/Flathub).
- Download a neural voice (e.g.,
en_US-lessac-medium). - In Pied, click the voice to configure
speech-dispatcher. - Restart the daemon:
killall speech-dispatcherd
- This script will automatically detect the new voice.
Created by brhacket • License GPL3