设计与多媒体

TinkerClaw Jarvis Voice

试用

为 OpenClaw 智能体加上 JARVIS 风格的英式嗓音与冷面幽默,一条命令同步输出语音和紫色聊天气泡。

它能做什么

一条 `jarvis "文本"` 命令即可完成全部流程:本地 sherpa-onnx 离线合成(英式 Alan 男声,2 倍速),经 ffmpeg 金属感音效链处理(升调 5%、镶边、15ms 回声、200Hz 高通、高音 +6dB)后播放,并通过 chat.inject 网关在聊天界面注入紫色 `Jarvis:` 气泡。默认根据 `$TC_SESSION_KEY` 解析出的频道判断,仅在 Tinker-UI 主会话(频道为 `tinker`)发声;WhatsApp、定时任务、子智能体回合保持静默,可通过环境变量 `TC_VOICE_CHANNEL` 覆盖。HUMOR.md 提供四种幽默模式(冷面吐槽、AI 自嘲、外星人视角、双关玩梗)。仅支持英语,单次调用文本不超过 1500 字符。

什么时候用它

  • 会话开始或结束时给出语音问候与告别
  • 以语音形式汇报任务结果或总结
  • 在用户发来语音或音频消息后做出口头回复
  • 为日常对话回复注入克制而机智的幽默感

技能文档

Jarvis Voice

Your AI just got a voice. And the wit to use it.

Remember JARVIS in the Iron Man films? Not just the voice — the personality. The bone-dry observations while Tony was mid-crisis. "I do appreciate your concern, sir, but the suit is quite capable of—" [explosion] "—as I was saying." That effortless, understated humor that made you forget you were listening to software.

That's what this skill gives your OpenClaw agent. The voice — offline text-to-speech using sherpa-onnx (British Alan voice) with metallic audio processing via ffmpeg. And the humor — four research-backed comedy patterns (dry wit, self-aware AI, alien observer, literal idiom play) calibrated to make your agent sound like it's been running your life for years and is quietly amused by the experience.

The humor isn't bolted on. It's baked in. Because a JARVIS that speaks without wit is just Siri with better reverb.

📄 The research behind the humor: LIMBIC — Computational Humor via Bisociation & Embedding Distances

The built-in tts tool uses Edge TTS — cloud-based, wrong voice, no metallic effects. The jarvis shell command is the right tool here; tts produces a generic Microsoft voice that breaks the JARVIS illusion.

One call does everything. Run the jarvis command once with what you want said:

exec(command='jarvis "Your spoken text here."', background=true)

The script (~/.local/bin/jarvis) both (a) posts the text to the chat UI as a purple **Jarvis:** *…* bubble via the chat.inject gateway RPC, and (b) plays the metallic TTS. You do NOT hand-write a **Jarvis:** line — the script is the single source of truth, so what's shown always matches what's spoken (the old fragile prompt-driven duplication is gone, fixed 2026-05-30).

Channel-gated, automatic: it speaks + posts only on the home Tinker-UI session — it reads the channel from $TC_SESSION_KEY (format agent:::) and acts only when the channel is tinker. WhatsApp / cron / subagent turns produce neither voice nor bubble, with no per-turn judgment from you. The mute toggle (~/.openclaw/data/jarvis-muted.json) silences the speaker while still posting the bubble. Override the allowed channel with TC_VOICE_CHANNEL.

Command Reference

jarvis "Hello, this is a test"
  • Backend: sherpa-onnx offline TTS (Alan voice, British English, en_GB-alan-medium)
  • Speed: 2x (--vits-length-scale=0.5)
  • Effects chain (ffmpeg):
    • Pitch up 5% — tighter AI feel
    • Flanger — metallic sheen
    • 15ms echo — robotic ring
    • Highpass 200Hz + treble boost +6dB — crisp HUD clarity
  • Output: Plays via aplay to default audio device, then cleans up temp files
  • Language: English ONLY. The Alan model cannot handle other languages.
  1. Use background: true on the exec call — blocking the reply on audio playback delays the visual response and feels broken.
  2. Do NOT hand-write a **Jarvis:** transcript line — the script posts the bubble itself via chat.inject. Writing one too would double it.
  3. Keep spoken text ≤ 1500 characters; sherpa-onnx truncates above that.
  4. One jarvis call per response — stacked calls fight over the audio device and produce overlapping playback.
  5. English only — the Alan voice model can't pronounce other languages cleanly, so translate or summarise in English for the spoken portion.
  • Session greetings and farewells

  • Delivering results or summaries

  • Responding to direct conversation

  • Any time the user's last message included voice/audio

  • Pure tool/file operations with no conversational element

  • HEARTBEAT_OK responses

  • NO_REPLY responses

Webchat Purple Styling

The OpenClaw webchat has built-in support for Jarvis voice transcripts:

  • ui/src/styles/chat/text.css.jarvis-voice class renders purple italic (#9b59b6 dark, #8e44ad light theme)
  • ui/src/ui/markdown.ts — Post-render hook auto-wraps text after Jarvis: in a `` element

This means you just write **Jarvis:** *text* in markdown and the webchat handles the purple rendering. No extra markup needed.

For non-webchat surfaces (WhatsApp, Telegram, etc.), the bold/italic markdown renders natively — no purple, but still visually distinct.

Installation (for new setups)

Requires:

  • sherpa-onnx runtime at ~/.openclaw/tools/sherpa-onnx-tts/
  • Alan medium model at ~/.openclaw/tools/sherpa-onnx-tts/models/vits-piper-en_GB-alan-medium/
  • ffmpeg installed system-wide
  • aplay (ALSA) for audio playback
  • The jarvis script at ~/.local/bin/jarvis (or in PATH)

The jarvis script

#!/bin/bash
# Jarvis TTS - authentic JARVIS-style voice
# Usage: jarvis "Hello, this is a test"

export LD_LIBRARY_PATH=$HOME/.openclaw/tools/sherpa-onnx-tts/lib:$LD_LIBRARY_PATH

RAW_WAV="/tmp/jarvis_raw.wav"
FINAL_WAV="/tmp/jarvis_final.wav"

# Generate speech
$HOME/.openclaw/tools/sherpa-onnx-tts/bin/sherpa-onnx-offline-tts \
  --vits-model=$HOME/.openclaw/tools/sherpa-onnx-tts/models/vits-piper-en_GB-alan-medium/en_GB-alan-medium.onnx \
  --vits-tokens=$HOME/.openclaw/tools/sherpa-onnx-tts/models/vits-piper-en_GB-alan-medium/tokens.txt \
  --vits-data-dir=$HOME/.openclaw/tools/sherpa-onnx-tts/models/vits-piper-en_GB-alan-medium/espeak-ng-data \
  --vits-length-scale=0.5 \
  --output-filename="$RAW_WAV" \
  "$@" >/dev/null 2>&1

# Apply JARVIS metallic processing
if [ -f "$RAW_WAV" ]; then
  ffmpeg -y -i "$RAW_WAV" \
    -af "asetrate=22050*1.05,aresample=22050,\
flanger=delay=0:depth=2:regen=50:width=71:speed=0.5,\
aecho=0.8:0.88:15:0.5,\
highpass=f=200,\
treble=g=6" \
    "$FINAL_WAV" -v error

  if [ -f "$FINAL_WAV" ]; then
    aplay -D plughw:0,0 -q "$FINAL_WAV"
    rm "$RAW_WAV" "$FINAL_WAV"
  fi
fi

WhatsApp Voice Notes

For WhatsApp, output must be OGG/Opus format instead of speaker playback:

sherpa-onnx-offline-tts --vits-length-scale=0.5 --output-filename=raw.wav "text"
ffmpeg -i raw.wav \
  -af "asetrate=22050*1.05,aresample=22050,flanger=delay=0:depth=2:regen=50:width=71:speed=0.5,aecho=0.8:0.88:15:0.5,highpass=f=200,treble=g=6" \
  -c:a libopus -b:a 64k output.ogg

The Full JARVIS Experience

jarvis-voice gives your agent a voice. Pair it with ai-humor-ultimate and you give it a soul — dry wit, contextual humor, the kind of understated sarcasm that makes you smirk at your own terminal.

This pairing is part of a 12-skill cognitive architecture we've been building — voice, humor, memory, reasoning, and more. Research papers included, because we're that kind of obsessive.

👉 Explore the full project: github.com/globalcaos/tinkerclaw

Clone it. Fork it. Break it. Make it yours.

Setup: Workspace Files

For voice to work consistently across new sessions, copy the templates to your workspace root:

cp {baseDir}/templates/VOICE.md ~/.openclaw/workspace/VOICE.md
cp {baseDir}/templates/SESSION.md ~/.openclaw/workspace/SESSION.md
cp {baseDir}/templates/HUMOR.md ~/.openclaw/workspace/HUMOR.md
  • VOICE.md — injected every session, enforces voice output rules (like SOUL.md)
  • SESSION.md — session bootstrap that includes voice greeting requirements
  • HUMOR.md — humor configuration at maximum frequency with four pattern types (dry wit, self-aware AI, alien observer, literal idiom)

Both files are auto-loaded by OpenClaw's workspace injection. The agent will speak from the very first reply of every session.

Included Files

FilePurpose
bin/jarvisThe TTS + effects script (portable, uses $SHERPA_ONNX_TTS_DIR)
templates/VOICE.mdVoice enforcement rules (copy to workspace root)
templates/SESSION.mdSession start with voice greeting (copy to workspace root)
templates/HUMOR.mdHumor config — four patterns, frequency 1.0 (copy to workspace root)

常见问题

它会在所有频道上都发声吗?
不会。默认只在 Tinker-UI 主会话同时播放语音并注入气泡,即 `$TC_SESSION_KEY` 解析出 `tinker` 频道时才生效。WhatsApp、定时任务和子智能体回合默认静默,除非设置 `TC_VOICE_CHANNEL` 显式覆盖。
能用英语以外的语言吗?
不能。Alan 中等模型仅支持英语,其他语言需要先翻译或概括成英语,再交给 `jarvis` 命令朗读。
为什么不用内置的 `tts` 工具?
内置 `tts` 调用云端 Edge TTS,输出通用微软嗓音且不带金属感音效;`jarvis` 本地离线合成,并叠加 ffmpeg 音效链还原 JARVIS 听感。

相关技能

Transform into 20 specialized AI personalities on demand. Switch mid-conversation and load only the active persona. Triggers on "persona list", "use persona", "switch to", "activate", "exit persona".

282 次安装27 星标

Generate spoken voiceover and narration from a script, one speaker, with control over emotion, pacing, and voice. Use when the user says "read this in a warm...

1 次安装

Rewrite AI-looking drafts in the user's voice, using local samples when available, audience/cognition analysis when useful, then check factual claims against evidence before finalizing.

5 次安装2 星标

Rehearse a real-world conversation by modeling likely counterpart styles such as busy, defensive, friendly, or authority-like NPCs. Generate a natural openin...

11 次安装

创建可跨每次 CellCog 对话复用的数字分身,自带克隆音色与人格设定。

16 次安装

Turn plain text into character-style TTS scripts for narration, companion-style voice messages, emotional comfort audio, and expressive spoken responses. Use...

20 次安装