Sayback
Accessible, code-aware voice reader for AI coding agents — MCP Server, VS Code/Cursor Visual Player & Live Terminal Controller.
Why Sayback?
Developers dealing with eye strain, low vision, or screen fatigue often struggle to read 20–200 line responses from AI coding agents (Claude Code, Cursor, Kilo Code, Cline, Roo Code, OpenCode).
- Basic
tts-mcpwrappers dump the entire text into one uninterruptiblespeak()call with no pause, resume, or chunk navigation. - Full screen readers (VoiceOver / NVDA) read every bracket, markdown symbol, and code diff aloud.
- Local neural TTS stacks typically require heavy GPUs or paid API keys.
Sayback is a lightweight, zero-GPU, zero-API-key companion across macOS, Linux, and Windows (v0.1.0 early alpha release).
Key Features
- Chunked Playback with Persistent Resume: Splits long explanations into natural 1–2 sentence chunks, prefetches upcoming chunks asynchronously to minimize pauses between sentences, and persists progress in
state.json. Even hours later—after the background daemon exits to free RAM—sayback resumecontinues from the beginning of the saved chunk. - Code-Aware Sanitizer: Strips fenced code blocks (including 4-backtick and unclosed fences), unified
git diffhunks, terminal ANSI escape codes, and raw URLs while preserving inline code identifiers (including generics likeVec<u8>) and shortening long file paths to basenames. - 12-Language Auto-Detection (Anchor Language): Detects
en,fa,ar,tr,de,fr,es,ru,zh,ja,ko, andhiwithout ML dependencies, separates Persian from Arabic, supports spaceless CJK chunking, and preserves independent language/voice metadata when multiple messages are queued (enqueue). - Non-Blocking MCP Server + Stop Hook: Returns control to your AI agent immediately once queued (warm daemon calls complete quickly; cold-starting the daemon on the first call takes ~0.5–1.5s). Includes a fault-tolerant
sayback hookfor Claude Code Stop hooks. - Single-Instance Local Daemon: Binds strictly to
127.0.0.1with a per-session random token (compare_digest), serializes concurrent playback commands, prevents overlapping audio across multiple IDE windows, and auto-exits after idle timeout. - Visual Player (VS Code / Cursor) & Live Terminal Controller:
- VS Code / Cursor Extension: Uncluttered Status Bar on the right (expands wide
Prev,Pause/Resume 3/12,Next,Replay,Stopcontrols only while active) + Bottom Panel player with dynamic 12-language voice selector, speed presets,S/M/L/XLscaling, ARIA/screen-reader labels, and automatic RTL/LTR (dir="auto") chunk display. - Terminal Live Controller (
sayback controller): Zero-dependency keyboard player (Space,←/→,r,c,s,+/-,q) for macOS, Linux, and Windows terminal workflows.
- VS Code / Cursor Extension: Uncluttered Status Bar on the right (expands wide
Privacy & Offline Behavior
Please review how Sayback handles text and network requests before using it on sensitive repositories:
- Online Neural TTS (
edge-tts): By default, Sayback sends the sanitized prose (after stripping code blocks and diffs) over HTTPS/WebSocket to Microsoft Edge's online neural TTS service (no API key or account required; Sayback itself collects zero telemetry). - Not a Secret Redactor: The sanitizer is designed for listening comfort, not secret scrubbing. Do not ask Sayback to read
.envfiles, API keys, or confidential credentials aloud. - Offline Fallback & Circuit Breaker: If you are offline or
edge-ttsis unreachable, Sayback opens a 60-second circuit breaker and automatically falls back to your OS speech engine (SAYBACK_TTS_ENGINE=systemforces offline-only mode permanently):- macOS: Built-in
say(supports English and installed system voices; note that macOS does not ship a default built-in Persian/Arabic/CJK voice unless manually downloaded). - Windows: Built-in
System.Speech(SAPI) via UTF-8 stdin. - Linux:
espeak-ngorespeak(if installed).
- macOS: Built-in
- Local Disk Storage & Cleanup: Playback state (
state.json) and cached audio files (audio/) are stored in private user directories (0700dirs /0600files on POSIX; no message history is retained). Runsayback clearanytime to wipe saved state and cached audio immediately.
Installation
1. Python Core (CLI + MCP Server)
# Recommended (isolated CLI install from PyPI)
pipx install sayback
# Or with uv
uv tool install sayback
# Or inside a virtual environment
pip install sayback
# Or install the latest commit directly from GitHub
pipx install "git+https://github.com/ELLPAA/sayback.git"
Linux Audio Prerequisite: Ensure at least one audio player is installed for MP3/WAV playback (
mpv,ffmpeg/ffplay, ormpg123). For offline fallback on Linux, installespeak-ng.
Verify your audio engine and TTS setup:
sayback doctor --live
sayback say "Sayback is ready to read your AI coding answers."
2. VS Code / Cursor Companion Extension
Download sayback-player-0.1.0.vsix from GitHub Releases (or build locally via python scripts/build_vsix.py), then install:
code --install-extension sayback-player-0.1.0.vsix
# Or for Cursor:
cursor --install-extension sayback-player-0.1.0.vsix
Reload the window (Cmd/Ctrl + Shift + P → Developer: Reload Window). Click Sayback in the bottom-right Status Bar to open the visual player in the Bottom Panel alongside Terminal.
Connecting AI Coding Agents
GUI Editor PATH Tip: Editors launched from macOS Dock/Spotlight or Windows Start Menu may not inherit
~/.local/bininPATH. If your agent reportssayback: command not found, runwhich sayback(macOS/Linux) orwhere sayback(Windows) and paste the absolute path into your MCP config.
1. Claude Code (MCP Server or Automatic Stop Hook)
Option A — MCP Server:
claude mcp add sayback -- sayback mcp
Option B — Automatic Stop Hook (~/.claude/settings.json):
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "sayback hook"
}
]
}
]
}
}
2. Cursor / Cline / Roo Code (mcp.json)
{
"mcpServers": {
"sayback": {
"command": "sayback",
"args": ["mcp"]
}
}
}
3. Kilo Code / OpenCode (kilo.jsonc / opencode.json)
{
"mcp": {
"sayback": {
"type": "local",
"command": ["sayback", "mcp"],
"enabled": true
}
}
}
Optional: Auto-Read Global Rule for MCP Clients
MCP registration exposes speak and control tools, but unlike Claude Code's Stop hook, clients such as Cursor, Kilo Code, Cline, Roo Code, and OpenCode only call speak automatically if instructed. Add this one-line rule to your agent's global/custom instructions whenever you want automatic spoken answers:
After answering an explanation or analysis question, call the `sayback` MCP `speak` tool once with your plain-language explanation (or a concise `spoken_summary`) so I can listen hands-free.
Exposed MCP Tools:
speak(text, spoken_summary="", mode="replace"|"enqueue", voice="", rate="")— Non-blocking chunked speech playback.control(action="pause"|"resume"|"toggle"|"stop"|"next"|"prev"|"replay"|"repeat"|"status"|"clear")— Playback control directly from voice/text prompts.
Live Terminal Controller (Outside VS Code)
Working in Claude Code, OpenCode, or any terminal workflow? Run:
sayback controller
# Alias: sayback ui
| Key | Action |
|---|---|
Space / p |
Play / Pause (resumes from the start of the saved chunk) |
← / h / b |
Previous chunk |
→ / l / n |
Next chunk |
r |
Replay entire last message from chunk 1 |
c |
Repeat current chunk |
s |
Stop playback |
+ / - |
Increase / decrease speech speed |
q / Esc |
Quit controller (playback continues in background) |
Built-In 12-Language Neural Voices
Sayback auto-detects the language by default (voice="auto"), or you can lock any voice via the VS Code dropdown or sayback prefs --voice <alias|id>:
| Code | Language | Default (Male) | Female |
|---|---|---|---|
en |
English | en-US-AndrewNeural (andrew) |
en-US-AriaNeural (aria) |
fa |
Persian (Farsi) | fa-IR-FaridNeural (farid) |
fa-IR-DilaraNeural (dilara) |
ar |
Arabic | ar-SA-HamedNeural (hamed) |
ar-EG-SalmaNeural (salma) |
tr |
Turkish | tr-TR-AhmetNeural (ahmet) |
tr-TR-EmelNeural (emel) |
de |
German | de-DE-ConradNeural (conrad) |
de-DE-KatjaNeural (katja) |
fr |
French | fr-FR-HenriNeural (henri) |
fr-FR-DeniseNeural (denise) |
es |
Spanish | es-ES-AlvaroNeural (alvaro) |
es-ES-ElviraNeural (elvira) |
ru |
Russian | ru-RU-DmitryNeural (dmitry) |
ru-RU-SvetlanaNeural (svetlana) |
zh |
Chinese | zh-CN-YunxiNeural (yunxi) |
zh-CN-XiaoxiaoNeural (xiaoxiao) |
ja |
Japanese | ja-JP-KeitaNeural (keita) |
ja-JP-NanamiNeural (nanami) |
ko |
Korean | ko-KR-InJoonNeural (injoon) |
ko-KR-SunHiNeural (sunhi) |
hi |
Hindi | hi-IN-MadhurNeural (madhur) |
hi-IN-SwaraNeural (swara) |
CLI Quick Reference
sayback say "Hello world" # Speak text (or pipe via stdin; use -- before text starting with -)
sayback toggle # Pause / resume from saved chunk
sayback prev | next # Jump backward / forward one chunk
sayback replay | repeat # Replay message from chunk 1 / repeat current chunk
sayback stop # Stop playback
sayback status # Show playback state and chunk progress
sayback clear # Wipe saved state.json and cached audio files
sayback prefs --rate +10% # Save default speed
sayback prefs --voice auto # Reset voice to 12-language auto-detect
sayback controller # Open live keyboard controller
sayback doctor --live # Run diagnostics + live synthesis check
Platform Support Status (v0.1.0 Alpha)
| Platform | Audio Playback | Offline Fallback | Verification Status |
|---|---|---|---|
| macOS | Built-in afplay |
Built-in say (Latin/installed voices) |
Live-verified on macOS + CI |
| Linux | mpv / ffplay / mpg123 / cvlc (MP3) + paplay/aplay (WAV) |
espeak-ng / espeak |
Automated CI matrix (Python 3.10–3.13); live desktop feedback welcome |
| Windows | Built-in winmm MCI (mpegvideo/waveaudio) |
Built-in System.Speech |
Automated CI matrix (Python 3.10–3.13); live desktop feedback welcome |
License
MIT License — see LICENSE.
Metadata
Release files for sayback 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sayback-0.1.0.tar.gz | 51.7 kB | Without provenance | Details for sayback-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sayback-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for sayback-0.1.0-py3-none-any.whl |
Total release size: 93.3 kB
Release files / sayback-0.1.0.tar.gz
| Download URL | sayback-0.1.0.tar.gz |
|---|---|
| Size | 51.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3fe29880d30e713cb3a1a52af95d2604ad8c0afd8d7f1a627742d1a5298e6e2c
|
|
BLAKE2b-256 checksum How to use checksums |
b95c50cb1e4d52a028874865345924168233769a6249e5cd29003542849013aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Release files / sayback-0.1.0-py3-none-any.whl
| Download URL | sayback-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39bdec337865e858ebda6e7b4c8197774ddf9f2325fb2ce18bc91a5c8932c8b0
|
|
BLAKE2b-256 checksum How to use checksums |
8061445f98da4d3bf2a5a5664dfd4195f12aa703601946cd82bebb6a65980fec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.17
|
Security for sayback 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.