skills$openclaw/telegram-offline-voice
sanwecn8.1k

by sanwecn

telegram-offline-voice – OpenClaw Skill

telegram-offline-voice is an OpenClaw Skills integration for coding workflows. 本地生成 Telegram 语音消息,无需 API Token。

8.1k stars1.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nametelegram-offline-voice
description本地生成 Telegram 语音消息,无需 API Token。 OpenClaw Skills integration.
ownersanwecn
repositorysanwecn/telegram-offline-voice
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @sanwecn/telegram-offline-voice
last updatedFeb 7, 2026

Maintainer

sanwecn

sanwecn

Maintains telegram-offline-voice in the OpenClaw Skills directory.

View GitHub profile
File Explorer
3 files
.
_meta.json
651 B
README.md
818 B
SKILL.md
2.5 KB
SKILL.md

name: telegram-offline-voice description: 本地生成 Telegram 语音消息,无需 API Token。 metadata: {"openclaw":{"emoji":"🎙️","os":["linux"],"requires":{"bins":["ffmpeg","edge-tts"]}}}

telegram-offline-voice 🎙️

本地生成,无需 Token — 使用 Microsoft Edge-TTS 生成高质量中文语音,完全离线处理,无需申请任何 API Key。

特性

  • 🔒 完全本地:无需 OpenAI / Google / Azure 等云服务 Token
  • 🎯 零成本:Edge-TTS 免费使用,无调用限制
  • 🗣️ 高质量声线:默认使用微软晓晓 (zh-CN-XiaoxiaoNeural)
  • 📱 Telegram 原生支持:输出格式符合语音气泡标准

安装依赖

# Edge-TTS
pip install edge-tts

# FFmpeg (Debian/Ubuntu)
apt install ffmpeg

使用方法

# 1. 生成原始音频
edge-tts --voice zh-CN-XiaoxiaoNeural --rate=+5% --text "你好,这是测试" --write-media raw.mp3

# 2. 转换为 Telegram 语音格式
ffmpeg -y -i raw.mp3 -c:a libopus -b:a 48k -ac 1 -ar 48000 -application voip voice.ogg

技术规范

文本格式清洗

生成语音前需清洗文本,避免朗读出标记符号:

需移除示例
Markdown 标记**加粗**`代码`# 标题
URL 链接https://example.com
特殊符号---***>>>

清洗示例:

# 简单清洗(去除常见 Markdown)
TEXT=$(echo "$RAW_TEXT" | sed 's/\*\*//g; s/`//g; s/^#\+ //g')

Telegram 语音气泡格式

Telegram 要求语音消息使用 OGG Opus 格式,否则会显示为文件而非语音气泡:

ffmpeg -i input.mp3 -c:a libopus -b:a 48k -ac 1 -ar 48000 -application voip output.ogg

参数说明:

参数说明
-c:alibopusTelegram 要求的编码器
-b:a48k音频比特率
-ac1单声道(语音标准)
-ar48000采样率 48kHz
-applicationvoip针对语音优化

可用声线

# 查看所有中文声线
edge-tts --list-voices | grep zh-CN

推荐:

  • zh-CN-XiaoxiaoNeural — 女声,自然亲和(默认)
  • zh-CN-YunxiNeural — 男声,沉稳专业
  • zh-CN-XiaoyiNeural — 女声,活泼年轻

语速调节

# 加速 5%
edge-tts --rate=+5% --text "..." --write-media out.mp3

# 减速 10%
edge-tts --rate=-10% --text "..." --write-media out.mp3

致谢

@sanwecn 调优并维护。

README.md

Telegram Offline Voice 🎙️

本地生成 Telegram 语音消息,无需 API Token。

使用 Microsoft Edge-TTS 生成高质量中文语音,完全本地处理,零成本,无限制。

快速开始

# 安装依赖
pip install edge-tts
apt install ffmpeg

# 生成语音
edge-tts --voice zh-CN-XiaoxiaoNeural --rate=+5% --text "你好" --write-media raw.mp3
ffmpeg -y -i raw.mp3 -c:a libopus -b:a 48k -ac 1 -ar 48000 -application voip voice.ogg

特性

  • 🔒 完全本地 — 无需云服务 Token
  • 🎯 零成本 — Edge-TTS 免费无限制
  • 🗣️ 高质量 — 微软神经网络语音
  • 📱 Telegram 原生 — 输出符合语音气泡标准

文档

详见 SKILL.md 获取完整技术规范。

致谢

@sanwecn 调优并维护。

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install telegram-offline-voice?

Run openclaw add @sanwecn/telegram-offline-voice in your terminal. This installs telegram-offline-voice into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/sanwecn/telegram-offline-voice. Review commits and README documentation before installing.