360 Secure SkillHub
360 安全技能中心

claw-voice-local

该 Skill 提供三个 Python 脚本:speak.py 调用本地 piper TTS 与 ffmpeg 将文本合成为 OGG Opus 音频,send_voice.py 通过 Telegram Bot API 发送语音消息,say.py 串联两者,支持命令行参数与标准输入,并从 OpenClaw 配置目录读取环境变量。

photon78
photon78
热度 47.23
最近更新 2026-05-11 17:45:33
分类:自动化依赖:代码执行 / 第三方 API / 读写文件应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add claw-voice-local
Metadata
name
claw-voice-local
description
Convert text to offline Telegram voice messages using piper TTS. Use when the agent should speak a response, send audio, or deliver voice notes via Telegram without internet connectivity.
license
MIT
compatibility
Requires piper TTS binary (Linux ARM64 or x86_64), ffmpeg, and a Telegram bot token. Python 3.11+.
metadata
{"author":"photon78","version":"1.0.0","env_required":"TELEGRAM_BOT_TOKEN","env_optional":"TELEGRAM_CHAT_ID"}

claw-voice-local

Local offline TTS → Telegram Voice Note

Convert any text to a Telegram voice message using piper TTS — fully offline, no cloud API required. Runs on Linux (including Raspberry Pi / ARM64).

When to use

  • Send spoken responses instead of text messages
  • Read out summaries, alerts, or reports
  • Any task where audio feedback is more natural than text

Usage

python3 say.py "Your agent is ready."
python3 say.py "Good morning!" --chat-id 123456789
echo "Task complete." | python3 say.py

Configuration

Set these environment variables (or add to ~/.openclaw/.env):

Variable Required Description
TELEGRAM_BOT_TOKEN Yes Your Telegram bot token
TELEGRAM_CHAT_ID Optional Default chat ID (can be passed as --chat-id)

Environment Variables

TELEGRAM_BOT_TOKEN=required   # Telegram bot token — get one from @BotFather
TELEGRAM_CHAT_ID=optional     # Default target chat ID

Config File

This skill reads ~/.openclaw/.env as a fallback for credentials. Ensure the file has restricted permissions: chmod 600 ~/.openclaw/.env

Installation

See README.md for step-by-step piper installation.

Files

File Description
say.py Main entry point: text → Telegram voice note
speak.py Core TTS: text → OGG Opus via piper + ffmpeg
send_voice.py Telegram sender: OGG → voice message (no dependencies)

Requirements

  • Python 3.11+
  • piper binary (see README)
  • ffmpeg
  • A piper voice model (.onnx)
  • Telegram bot token