openclaw - 💡(How to fix) Fix [Bug] TTS 语音通过非 WEB 渠道发送时变成文件路径字符串 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#53722Fetched 2026-04-08 01:24:23
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

问题描述

通过飞书机器人发送语音消息时,机器人回复的 TTS 语音收到的是一个 mp3 文件路径字符串,而不是可播放的语音。

问题原因

OpenClaw 在 reply-payload.ts 中处理回复消息时,只检查了 textmediaUrl完全忽略了 audioAsVoice(TTS 语音)

TTS 语音被生成后放入 payload.audioAsVoice,但消息发送逻辑没有处理这个字段,导致:

  1. TTS 语音被生成
  2. 发送逻辑忽略了 audioAsVoice
  3. 飞书收到的是文本(文件路径)

期望行为

  • WEB 渠道:保持现有逻辑,页面有语音播放按钮
  • 飞书/QQ/其他 APP 渠道:将 TTS 语音当作该平台的语音消息发送(如飞书的 sendAudioLark()

技术分析

飞书插件已实现 sendAudioLark() 函数(位于 src/messaging/outbound/media.d.ts),使用 msg_type: "audio" 可发送可播放的语音气泡。

需要在 OpenClaw 核心的消息发送逻辑中添加对 audioAsVoice 的处理,根据目标渠道选择正确的发送方式。

环境信息

  • OpenClaw 版本:2026.3.x
  • 飞书插件版本:2026.3.24
  • 操作系统:Windows

相关代码位置

  • openclaw/dist/reply-payload-MXtGsVoh.js - 回复负载处理
  • @larksuite/openclaw-lark/src/messaging/outbound/media.d.ts - 飞书音频发送

本问题由 OpenClaw AI Agent 报告

extent analysis

Fix Plan

To fix the issue, we need to modify the message sending logic in OpenClaw to handle the audioAsVoice field. Here are the steps:

  • Modify the reply-payload.ts file to check for the audioAsVoice field in the payload.
  • If the field exists, use the sendAudioLark() function from the Feishu plugin to send the TTS audio as a playable voice message.
  • For web channels, keep the existing logic to display a playable audio button.

Example code:

// reply-payload.ts
if (payload.audioAsVoice) {
  // Use sendAudioLark() for Feishu and other supported channels
  if (channel === 'feishu') {
    sendAudioLark(payload.audioAsVoice);
  } else {
    // Handle other channels or fall back to existing logic
  }
} else {
  // Existing logic for text and mediaUrl
}

Verification

To verify the fix, send a TTS audio message through the Feishu channel and check if the recipient receives a playable voice message instead of a text file path.

Extra Tips

  • Make sure to update the Feishu plugin to the latest version to ensure compatibility with the sendAudioLark() function.
  • Test the fix on different channels and platforms to ensure consistent behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug] TTS 语音通过非 WEB 渠道发送时变成文件路径字符串 [1 participants]