← Back to Plugins
Tools

Javis Tts

fuleinist By fuleinist 👁 85 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...