Telegram Voice To Voice Macos
简介
Telegram Voice To Voice Macos
原始描述
Telegram voice-note assistant for macOS Apple Silicon: transcribe inbound OGG/Opus audio locally with yap and Speech.framework, generate replies, and send Telegram voice notes with say + ffmpeg. Supports voice or text reply mode.
通过你的 Agent 添加
安装目录:telegram-voice-to-voice-macos/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: telegram-voice-to-voice-macos
description: "Telegram voice-to-voice for macOS Apple Silicon: transcribe inbound .ogg voice notes with yap (Speech.framework) and reply with Telegram voice notes via say+ffmpeg. Not compatible with Linux/Windows."
metadata: {"openclaw":{"os":["darwin"],"requires":{"bins":["yap","ffmpeg","say","defaults"]}}}
Telegram voice-to-voice (macOS Apple Silicon only)
This is an OpenClaw skill.
Requirements
- macOS on Apple Silicon.
yap CLI available in PATH (Speech.framework transcription).
- Project: https://github.com/finnvoor/yap (by finnvoor)
ffmpeg available in PATH.
Compatibility note (important)
yap CLI available in PATH (Speech.framework transcription).
- Project: https://github.com/finnvoor/yap (by finnvoor)
ffmpeg available in PATH.This skill is macOS-only (uses say + Speech.framework). The skill registry cannot enforce OS restrictions, so installing/running it on Linux/Windows will result in runtime failures.
Persistent reply mode (voice vs text)
Store a small per-user preference file in the workspace:
- State file:
voice_state/telegram.json - Key: Telegram sender user id (string)
- Values:
"voice"(default): reply with a Telegram voice note"text": reply with a single text message
If the file does not exist or the sender id is missing: assume "voice".
Toggle commands
If an inbound text message is exactly:
/audio off→ set state to"text"and confirm with a short text reply./audio on→ set state to"voice"and confirm with a short text reply.
Getting the inbound audio (.ogg)
Telegram voice notes often show up as <media:audio> in message text.
OpenClaw saves the attachment to disk (typically .ogg) under:
~/.openclaw/media/inbound/
Recommended approach:
- If the inbound message context includes an attachment path, use it.
- Otherwise, take the most recent
*.oggfrom~/.openclaw/media/inbound/.
Transcription
Default locale: macOS system locale.
Optional env:
YAP_LOCALE— override the transcription locale (e.g.it-IT,en-US).
Preferred:
yap transcribe --locale "${YAP_LOCALE:-<system>}" <path.ogg>- If
YAP_LOCALEis not set, the helper script will use the macOS system locale (fromdefaults read -g AppleLocale).
- If
If transcription fails or is empty: ask the user to repeat or send text.
Helper script:
scripts/transcribe_telegram_ogg.sh [path.ogg]
Reply behavior
Mode: voice (default)
Voice default: SYSTEM (uses the current macOS system voice). You can override by passing a specific voice name to the helper script.
- Generate the reply text.
- Convert reply text to an OGG/Opus voice note using:
scripts/tts_telegram_voice.sh "<reply text>" [SYSTEM|VoiceName]
The script prints the generated .ogg path to stdout.
- Send the
.oggback to Telegram as a voice note (not a generic audio file):
- use the
messagetool withasVoice: trueandmedia: <path.ogg> - optionally set
replyToto thread the response
Notes:
- Use
SYSTEMto rely on the current macOS system voice (recommended).
Mode: text
Reply with a single text message:
Transcription: <...>Reply: <...>
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。