← 返回
效率工具 中文

iMessage Voice Reply

Send voice message replies in iMessage using local Kokoro-ONNX TTS. Generates native iMessage voice bubbles (CAF/Opus) that play inline with waveform — not f...
利用本地 Kokoro-ONDX TTS 在 iMessage 中发送语音回复。生成原生 iMessage 语音气泡(CAF/Opus),支持内联播放与波形显示。
bolander72
效率工具 clawhub v1.0.3 1 版本 99895 Key: 无需
★ 0
Stars
📥 951
下载
💾 20
安装
1
版本
#latest

概述

iMessage Voice Reply

Generate and send native iMessage voice messages using local Kokoro TTS. Voice messages appear as inline playable bubbles with waveforms — identical to voice messages recorded in Messages.app.

How It Works

Your text response → Kokoro TTS (local) → afconvert (native Apple encoder) → CAF/Opus → BlueBubbles → iMessage voice bubble

Setup

bash ${baseDir}/scripts/setup.sh

Installs: kokoro-onnx, soundfile, numpy. Downloads Kokoro models (~136MB) to ~/.cache/kokoro-onnx/.

Requires: BlueBubbles channel configured in OpenClaw (channels.bluebubbles).

Generating and Sending a Voice Reply

Step 1: Generate audio

Write the response text to a temp file, then pass it via --text-file to avoid shell injection:

echo "Your response text here" > /tmp/voice_text.txt
${baseDir}/.venv/bin/python ${baseDir}/scripts/generate_voice_reply.py --text-file /tmp/voice_text.txt --output /tmp/voice_reply.caf

Alternatively, pass text directly (ensure proper shell escaping):

${baseDir}/.venv/bin/python ${baseDir}/scripts/generate_voice_reply.py --text "Your response text here" --output /tmp/voice_reply.caf

Options:

  • --voice af_heart — Kokoro voice (default: af_heart)
  • --speed 1.15 — Playback speed (default: 1.15)
  • --lang en-us — Language code (default: en-us)

Security note: The Python script uses argparse and subprocess.run with list arguments (no shell=True). Input is handled safely within the script. When calling from a shell, prefer --text-file for untrusted input to avoid shell metacharacter issues.

Step 2: Send via BlueBubbles

Use the message tool:

{
  "action": "sendAttachment",
  "channel": "bluebubbles",
  "target": "+1XXXXXXXXXX",
  "path": "/tmp/voice_reply.caf",
  "filename": "Audio Message.caf",
  "contentType": "audio/x-caf",
  "asVoice": true
}

Critical parameters for native voice bubble:

  • filename must be "Audio Message.caf"
  • contentType must be "audio/x-caf"
  • asVoice must be true

All three are required for iMessage to render the message as an inline voice bubble with waveform instead of a file attachment.

Voice Options

LanguageFemaleMale
------------------------
Englishaf_heart ⭐am_puck
Spanishef_doraem_alex
Frenchff_siwis
Japanesejf_alphajm_beta
Chinesezf_xiaobeizm_yunjian

When to Reply with Voice

Reply with a voice message when:

  • The user sent you a voice message (voice-for-voice)
  • The user explicitly asks for an audio/voice response

Always include a text reply alongside the voice message for accessibility.

Audio Format

  • macOS: CAF container, Opus codec, 48kHz mono, 32kbps — encoded by Apple's native afconvert. Identical to what Messages.app produces.
  • Fallback: MP3 via ffmpeg (works but may not render as native voice bubble on all iMessage versions).

Cost

$0. Kokoro TTS runs entirely locally. No API calls for voice generation.

Troubleshooting

Voice message shows as file attachment — Ensure all three parameters are set: filename="Audio Message.caf", contentType="audio/x-caf", asVoice=true.

First word clipped — The script prepends 150ms silence automatically. If still clipped, increase the silence pad in the script.

Kokoro model not found — Run bash ${baseDir}/scripts/setup.sh.

afconvert not found — Only available on macOS. Script falls back to ffmpeg/MP3 on Linux.

版本历史

共 1 个版本

  • v1.0.3 当前
    2026-03-29 10:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,188
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,973
productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 433 📥 103,868