← 返回
沟通协作

Voice Message

Send voice messages across chat channels (Telegram, Discord, Feishu/Lark, Signal, WhatsApp, and others) using edge-tts for text-to-speech and ffmpeg for audi...
{"answer": "使用 edge-tts 和 ffmpeg 跨聊天频道(Telegram、Discord、飞书、Signal、WhatsApp 等)发送语音消息..."}
xmanrui
沟通协作 clawhub v1.0.4 1 版本 99944.1 Key: 无需
★ 2
Stars
📥 1,747
下载
💾 58
安装
1
版本
#latest

概述

Voice Message

Send text as voice messages to any chat channel.

Prerequisites

  • edge-tts — Microsoft Edge TTS (pip install edge-tts)
  • ffmpeg / ffprobe — audio conversion and duration detection

Default Voices

Step 1: Generate Voice File

Use scripts/gen_voice.sh to convert text to an ogg/opus file:

scripts/gen_voice.sh "你好" /tmp/voice.ogg
scripts/gen_voice.sh "Hello" /tmp/voice.ogg en-US-JennyNeural

Arguments: [voice]

  • If voice is omitted, defaults to zh-CN-XiaoxiaoNeural.

Step 2: Send by Channel

Generic (Telegram, Signal, WhatsApp, etc.)

Use the message tool directly:

action=send, asVoice=true, filePath=/tmp/voice.ogg

This works for most channels. Telegram confirmed working.

Feishu/Lark

⚠️ Feishu does NOT support asVoice=true via the message tool. You must use the dedicated script.

Use scripts/send_feishu_voice.sh:

scripts/send_feishu_voice.sh /tmp/voice.ogg <receive_id> <tenant_access_token> [receive_id_type]
  • receive_id_type: open_id (default), chat_id, user_id, union_id, email
  • The script handles upload (as opus with duration) and sends as audio message type to produce a voice bubble.
  • To get tenant_access_token, use the Feishu tenant token API with your app credentials.

Discord

Discord voice messages require a waveform and special flags.

  1. Generate ogg with scripts/gen_voice.sh
  2. Generate waveform: python3 scripts/gen_waveform.py /tmp/voice.ogg
    • Outputs JSON: {"duration_secs": 4.2, "waveform": "base64..."}
  3. Send via Discord API with flags: 8192 (IS_VOICE_MESSAGE) and the waveform/duration in attachments metadata.
    • Missing waveform/duration causes error 50161.

Fallback

If asVoice=true does not produce a voice bubble on a channel:

  1. Try sending via the platform's native API
  2. If native API unavailable, send as audio file attachment

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-03-29 12:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 114 📥 52,425
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,589
data-analysis

OpenClaw Bot Dashboard

xmanrui
启动并管理 OpenClaw Dashboard 网页界面,监控所有机器人、代理、模型和会话。自动检测操作系统、检查更新并...
★ 0 📥 1,118