openclaw - 💡(How to fix) Fix [Feature]: WeChat channel voice message sending support (asVoice parameter not working) [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#59417Fetched 2026-04-08 02:24:03
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Enable WeChat channel to send voice messages when asVoice parameter is set, converting text to SILK-encoded audio via CDN upload

Root Cause

Enable WeChat channel to send voice messages when asVoice parameter is set, converting text to SILK-encoded audio via CDN upload

RAW_BUFFERClick to expand / collapse

Summary

Enable WeChat channel to send voice messages when asVoice parameter is set, converting text to SILK-encoded audio via CDN upload

Problem to solve

When using the WeChat channel (openclaw-weixin plugin), the asVoice parameter is accepted but has no effect. Users expect that when asVoice=true is passed to message tool, the bot should send a voice message instead of text.

Current behavior:

  • User sends voice to bot → bot receives it correctly
  • Bot sends with asVoice=true → text message is sent instead of voice

The WeChat plugin has sendVoiceMessageWeixin() implemented in src/messaging/send.ts, but the channel.ts does not implement the voice sending flow when asVoice is set. The core framework passes audioAsVoice flag but no actual conversion from text to SILK audio + CDN upload happens.

Proposed solution

Implement the voice message sending flow in the WeChat channel plugin:

  1. When asVoice=true is received, call TTS to generate audio (WAV/PCM)
  2. Convert audio to SILK format using silk-wasm encoder
  3. Calculate MD5, AES-128-ECB encrypt the file
  4. Call getUploadUrl to get CDN upload pre-signed URL
  5. Upload encrypted audio to CDN
  6. Call sendMessage with MessageItem type=3 (VOICE) containing the CDN reference
  7. Parameters needed: encode_type (5 for SILK), sample_rate (8000), playtimeMs

The plugin already has all required infrastructure:

  • sendVoiceMessageWeixin() in src/messaging/send.ts
  • uploadBufferToCdn() in src/cdn/cdn-upload.ts
  • SILK encoder packages available (silk-wasm on npm)

This mirrors how sendImageMessageWeixin and sendVideoMessageWeixin work.

Alternatives considered

No response

Impact

Affected users: WeChat channel users who want voice responses Severity: Medium - blocks natural voice interaction Frequency: Always when trying to send voice Consequences: Users must receive text instead of voice, reducing the human-like feel of the assistant

This is especially important for Chinese users where WeChat is the primary communication channel and voice messages are commonly used.

Evidence/examples

Code evidence:

  • sendVoiceMessageWeixin exists: ~/.openclaw/extensions/openclaw-weixin/src/messaging/send.ts (line 244)
  • The function takes: to, text, uploaded (CDN reference), playtimeMs, sampleRate, encodeType
  • SILK encoder available: silk-wasm npm package supports encode(pcmData, sampleRate)
  • WeChat API supports voice type=3 in MessageItem

Similar implementations for reference:

  • sendImageMessageWeixin (line 180) - works correctly
  • sendVideoMessageWeixin (line 215) - works correctly

Additional information

No response

extent analysis

TL;DR

Implement the voice message sending flow in the WeChat channel plugin by converting text to SILK-encoded audio and uploading it to CDN when the asVoice parameter is set.

Guidance

  • Modify the channel.ts file to implement the voice sending flow when asVoice is set, utilizing the existing sendVoiceMessageWeixin() function in src/messaging/send.ts.
  • Use the silk-wasm encoder package to convert text to SILK-encoded audio.
  • Call uploadBufferToCdn() in src/cdn/cdn-upload.ts to upload the encrypted audio to CDN.
  • Pass the required parameters, including encode_type, sample_rate, and playtimeMs, to sendMessage with MessageItem type=3 (VOICE) containing the CDN reference.

Example

// Example conversion and upload flow
const text = 'Hello, world!';
const audio = tts.generateAudio(text); // Generate audio using TTS
const silkAudio = silkWasm.encode(audio, 8000); // Convert to SILK format
const encryptedAudio = encryptAudio(silkAudio); // Encrypt audio
const uploadUrl = getUploadUrl(); // Get CDN upload pre-signed URL
uploadBufferToCdn(encryptedAudio, uploadUrl); // Upload encrypted audio to CDN
const messageItem = {
  type: 3, // VOICE
  url: uploadUrl,
  playtimeMs: 3000,
  sampleRate: 8000,
  encodeType: 5, // SILK
};
sendMessage(messageItem); // Send voice message

Notes

The implementation should mirror the existing sendImageMessageWeixin and sendVideoMessageWeixin functions, and utilize the available silk-wasm encoder package.

Recommendation

Apply the workaround by implementing the voice message sending flow in the WeChat channel plugin, as this will enable the desired functionality for users.

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