Bug Description
When TTS is enabled or when sending voice messages via the message tool with asVoice: true, the messages are delivered as audio file attachments instead of native voice message bubbles in Matrix clients (Element, FluffyChat, etc.).
Expected Behavior
Voice messages should display as native voice message bubbles (with waveform, duration, play button) in Matrix clients.
According to MSC3245, this requires "org.matrix.msc3245.voice": {} in the content object.
Actual Behavior
Audio is sent as m.audio attachment without the voice indicator, displaying as a generic file card.
Root Cause Found
In extensions/matrix/src/outbound.ts, the sendMedia adapter is missing the audioAsVoice parameter:
sendMedia: async ({ to, text, mediaUrl, deps, replyToId, threadId }) => {
const send = deps?.sendMatrix ?? sendMessageMatrix;
const resolvedThreadId =
threadId !== undefined && threadId !== null ? String(threadId) : undefined;
const result = await send(to, text, {
mediaUrl,
replyToId: replyToId ?? undefined,
threadId: resolvedThreadId,
// ❌ MISSING: audioAsVoice is not passed here
});
...
}
The underlying sendMessageMatrix function in send.ts supports audioAsVoice: true (line ~70-75), and buildMediaContent in media.ts correctly sets org.matrix.msc3245.voice: {} when isVoice: true, but the sendMedia adapter never passes this flag.
The message tool exposes asVoice: true, but this is not being propagated to audioAsVoice.
Affected Components
extensions/matrix/src/outbound.ts - sendMedia adapter
- extensions/matrix/src/matrix/send.ts -
sendMessageMatrix function (already supports the parameter)
Environment
- OpenClaw version: 2026.2.9
- TTS provider: ElevenLabs (eleven_multilingual_v2)
- Channel: Matrix
- Client: Element Web/Desktop
Related Issues
Suggested Fix
Update sendMedia in outbound.ts to accept and pass audioAsVoice: true when asVoice is set in the message tool options.
sendMedia: async ({ to, text, mediaUrl, deps, replyToId, threadId, asVoice }) => {
...
const result = await send(to, text, {
mediaUrl,
replyToId: replyToId ?? undefined,
threadId: resolvedThreadId,
audioAsVoice: asVoice, // ✅ Add this line
});
...
}
Bug Description
When TTS is enabled or when sending voice messages via the
messagetool withasVoice: true, the messages are delivered as audio file attachments instead of native voice message bubbles in Matrix clients (Element, FluffyChat, etc.).Expected Behavior
Voice messages should display as native voice message bubbles (with waveform, duration, play button) in Matrix clients.
According to MSC3245, this requires
"org.matrix.msc3245.voice": {}in the content object.Actual Behavior
Audio is sent as
m.audioattachment without the voice indicator, displaying as a generic file card.Root Cause Found
In
extensions/matrix/src/outbound.ts, thesendMediaadapter is missing theaudioAsVoiceparameter:The underlying
sendMessageMatrixfunction insend.tssupportsaudioAsVoice: true(line ~70-75), andbuildMediaContentinmedia.tscorrectly setsorg.matrix.msc3245.voice: {}whenisVoice: true, but thesendMediaadapter never passes this flag.The
messagetool exposesasVoice: true, but this is not being propagated toaudioAsVoice.Affected Components
extensions/matrix/src/outbound.ts-sendMediaadaptersendMessageMatrixfunction (already supports the parameter)Environment
Related Issues
Suggested Fix
Update
sendMediainoutbound.tsto accept and passaudioAsVoice: truewhenasVoiceis set in themessagetool options.