← Back to Plugins
Tools

Javis Tts

fuleinist By fuleinist 👁 257 views ▲ 0 votes

Javis — a local TTS notification plugin for OpenClaw. Speaks ambient alerts, briefings, and research updates to your PC.

GitHub

Install

pip install melotts

README

# 🎙️ Javis — Local TTS Plugin for OpenClaw

> A privacy-first, ambient voice assistant that speaks notifications, briefings, and research results directly to your PC.

[![OpenClaw Plugin](https://img.shields.io/badge/OpenClaw-Ready-brightgreen?style=flat-square)](https://openclaw.ai)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE)

## What is Javis?

Javis is an OpenClaw plugin that continuously talks to you on your local PC using high-quality text-to-speech. Unlike cloud TTS services, Javis runs entirely locally — your data never leaves your machine.

**Core use cases:**
- 🌅 **Morning Briefing** — Wake up to a summary of your calendar, weather, and overnight GitHub activity
- 🔔 **GitHub Live Changelog** — Get notified when PRs are merged or issues are filed in your repos
- 📡 **Research Loop Speaker** — Javis narrates findings during long research sessions, like pair programming
- 🧠 **Memory Pulse** — When memory mining completes, Javis reads the highlights aloud
- 🚨 **Priority Alerts** — Critical system alerts spoken immediately regardless of what you're doing

## Tech Stack

| Layer | Technology | Why |
|---|---|---|
| **TTS Engine (default)** | [MeloTTS](https://github.com/myshell-ai/MeloTTS) | CPU real-time, MIT licensed, <1s latency, multi-lingual |
| **TTS Engine (premium)** | [ElevenLabs](https://elevenlabs.io) (via `sag` skill) | World-class quality, 75ms streaming |
| **Fallback** | macOS `say` / Piper TTS | Zero-dependency, ONNX-based |
| **Audio Playback** | `afplay` (macOS) / `paplay` (Linux) | Native, no extra deps |
| **Trigger Platform** | OpenClaw (cron, hooks, agents) | Already running locally |

## Architecture

```
OpenClaw (cron/agent events)
    │
    ▼
Javis TTS Service (Python)
├── melo_tts.py       # MeloTTS engine wrapper
├── piper_tts.py      # Piper TTS (optional, ONNX)
├── elevenlabs.py     # ElevenLabs via sag skill
└── audio_player.py   # Cross-platform playback
    │
    ▼
Speaker / Headphones 🎧
```

## TTS Engine Comparison

| Engine | Latency | Quality | Cost | Privacy | Setup |
|---|---|---|---|---|---|
| **MeloTTS** | <1s (CPU RT) | Good | Free (MIT) | ✅ 100% local | `pip install` |
| **Piper TTS** | <1s (ONNX) | Good | Free (Apache 2.0) | ✅ 100% local | Medium |
| **ElevenLabs** | 75ms streaming | Excellent | $$$ | ❌ Cloud | Trivial (API key) |
| **macOS `say`** | <0.1s | Poor–Okay | Free | ✅ 100% local | None (built-in) |

> **Decision:** Use MeloTTS as the default ambient engine. ElevenLabs as an optional premium upgrade. macOS `say` as the zero-dependency fallback.

## Quick Start

### 1. Install MeloTTS

```bash
pip install melotts
```

### 2. Clone the plugin

```bash
git clone https://github.com/fuleinist/javis-tts-plugin.git
cd javis-tts-plugin
```

### 3. Test it

```bash
python3 -c "
from melo_tts import JavisTTS
tts = JavisTTS()
tts.speak('Javis is online. Your morning briefing is ready.')
"
```

### 4. Wire into OpenClaw

Add to your OpenClaw cron or agent to trigger on events:

```bash
# Example: OpenClaw cron hook → morning briefing
0 6 * * * python3 /path/to/javis-tts-plugin/melo_tts.py "Good morning! You have 3 meetings today."
```

## Project Structure

```
javis-tts-plugin/
├── README.md              # This file
├── IMPLEMENTATION.md      # Detailed implementation plan
├── melo_tts/
│   ├── melo_tts.py        # Core MeloTTS service
│   └── requirements.txt
├── piper_tts/
│   ├── piper_tts.py       # Piper TTS service
│   └── requirements.txt
├── elevenlabs_tts/
│   └── elevenlabs_tts.py  # ElevenLabs via sag
├── openclaw_integration/
│   ├── cron_examples.sh    # Example cron triggers
│   └── openclaw_hook.py   # Python hook for OpenClaw agents
└── examples/
    ├── morning_briefing.py
    ├── github_notifier.py
    └── research_loop_speaker.py
```

## Key Patterns

### Streaming Audio (don't wait for full generation)

For ambient notifications, the critical pattern is **stream and play concurrently** — start audio playback as soon as the first chunk arrives, don't wait for full generation.

```python
# Conceptual pattern — generate and play concurrently
import threading

def speak_async(text):
    thread = threading.Thread(target=generate_and_play, args=(text,))
    thread.start()

def generate_and_play(text):
    # Generate audio
    audio = melo_tts.tts(text)
    # Play immediately when ready
    audio_player.play(audio)
```

### Audio Ducking

When your user is listening to music, Javis should lower the volume while speaking:

```bash
# macOS: lower music volume while speaking, then restore
osascript -e 'set volume output volume 30'
say "Stand-up meeting in 5 minutes"
osascript -e 'set volume output volume 70'
```

## Relevant Repos

| Repo | Purpose | Stars |
|---|---|---|
| [myshell-ai/MeloTTS](https://github.com/myshell-ai/MeloTTS) | Primary recommended engine | 6k+ |
| [rhasspy/piper](https://github.com/rhasspy/piper) | ONNX TTS (battle-tested) | 9k+ |
| [coqui-ai/TTS](https://github.com/coqui-ai/TTS) | Full TTS library (VITS, XTTS) | 32k+ |
| [KoljaB/RealtimeTTS](https://github.com/KoljaB/RealtimeTTS) | Streaming TTS with callbacks | 1k+ |
| [jitendraparande/piper-streaming](https://github.com/jitendraparande/piper-streaming) | Node HTTP streaming for Piper | |

## License

MIT — free for personal and commercial use.
tools

Comments

Sign in to leave a comment

Loading comments...