openclaw - 💡(How to fix) Fix [Feature Request] openclaw-weixin: 支持发送原生微信语音消息(语音气泡) [2 comments, 2 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#77778Fetched 2026-05-06 06:21:38
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
commented ×2closed ×1
RAW_BUFFERClick to expand / collapse

需求描述

当前 openclaw-weixin 插件支持接收微信语音(SILK 解码),但发送音频时被路由为文件附件(sendFileMessageWeixin),不支持发送原生微信语音气泡。

期望行为

  • TTS 生成的 mp3/wav 音频 → 转换为微信支持的语音格式 → 通过微信公众号语音消息接口发送
  • 用户在微信中看到语音气泡,点一下就能听(无需下载)

技术参考

  • 微信 API 支持 voice 消息类型,需先上传语音到微信服务器获取 media_id
  • 语音格式支持:AMR、MP3(16KHz 采样率)
  • send-media.ts 目前只有 image/video/file 三条路由,缺少 audio/voice 分支

使用场景

AI 助手通过 TTS 向用户发送语音问候、提醒、总结,增强交互自然度。

extent analysis

TL;DR

To fix the issue, modify the send-media.ts file to add support for audio/voice messages by uploading the audio to the WeChat server and obtaining a media_id before sending the voice message.

Guidance

  • Identify the audio format generated by the TTS system and ensure it matches one of the supported formats by WeChat (AMR or MP3 with 16KHz sampling rate).
  • Update the send-media.ts file to include a new route for handling audio/voice messages, using the WeChat API to upload the audio and obtain a media_id.
  • Modify the sendFileMessageWeixin function to handle audio files differently, using the new audio/voice message route instead of treating them as file attachments.
  • Test the updated code with different audio formats and scenarios to ensure compatibility and correct behavior.

Example

// Example of how to upload audio to WeChat server and obtain media_id
const audioBuffer = // audio data generated by TTS
const audioType = 'audio/mp3'; // or 'audio/amr'
const mediaId = await uploadMediaToWeChat(audioBuffer, audioType);
const voiceMessage = {
  msgtype: 'voice',
  voice: {
    media_id: mediaId,
  },
};
// Send the voice message using the WeChat API

Notes

The solution assumes that the TTS system generates audio in a format compatible with WeChat's requirements. Additional error handling and logging may be necessary to ensure robustness.

Recommendation

Apply workaround: Modify the send-media.ts file to add support for audio/voice messages, as this will allow the system to send voice messages correctly without requiring a full upgrade.

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 [Feature Request] openclaw-weixin: 支持发送原生微信语音消息(语音气泡) [2 comments, 2 participants]