-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Matrix TTS replies not sent as voice bubbles — missing from VOICE_BUBBLE_CHANNELS #37061
Description
Bug type
Behavior bug (incorrect output/state without crash)
Summary
When messages.tts.auto: "inbound" is configured and a user sends a voice message on Matrix, the TTS reply audio is sent as a generic audio file attachment instead of a native voice message bubble (MSC3245). This is because "matrix" is not included in the VOICE_BUBBLE_CHANNELS set in src/tts/tts.ts.
Root Cause
In the TTS pipeline (src/tts/tts.ts):
const VOICE_BUBBLE_CHANNELS = new Set([
"telegram",
"feishu",
"whatsapp",
]);Matrix is missing from this set. This causes two cascading issues:
resolveOutputFormat("matrix")returnsDEFAULT_OUTPUTwithopenai: "mp3"andvoiceCompatible: falseinstead ofTELEGRAM_OUTPUTwithopenai: "opus"andvoiceCompatible: true- The reply dispatcher sets
audioAsVoice: result.voiceCompatible === true→false, so the Matrix send pipeline never applies MSC3245 voice metadata
Even though extensions/matrix/src/matrix/send.ts fully supports audioAsVoice and correctly injects org.matrix.msc3245.voice + org.matrix.msc1767.audio, the TTS pipeline never sets this flag for Matrix.
Steps to reproduce
- Configure
messages.tts.auto: "inbound"and an OpenAI-compatible TTS provider - Send a voice message to the bot on Matrix (Element)
- Bot transcribes, generates a reply, and runs TTS
- TTS audio is sent as a generic file attachment, not a voice bubble
Expected behavior
TTS replies on Matrix should:
- Use Opus format (like Telegram/Feishu/WhatsApp)
- Set
voiceCompatible: true - Be sent as MSC3245 voice message bubbles with waveform, duration, and inline playback
Actual behavior
TTS replies on Matrix:
- Use MP3 format (
DEFAULT_OUTPUT) - Set
voiceCompatible: false - Appear as downloadable file attachments without inline playback
Suggested fix
Add "matrix" to VOICE_BUBBLE_CHANNELS:
const VOICE_BUBBLE_CHANNELS = new Set([
"telegram",
"feishu",
"whatsapp",
"matrix", // Matrix supports MSC3245 voice messages
]);This would make the TTS pipeline use Opus format and set voiceCompatible: true for Matrix, enabling native voice bubbles.
Related issues
- Matrix: Voice messages sent as audio files instead of native voice messages #14225 — Matrix
sendMediaadapter missingaudioAsVoicepass-through (different layer) - [Bug]: Matrix
messagetool ignoresaudioAsVoiceparameter #32489 —messagetoolaudioAsVoicenot wired to Matrix (different layer) - Both related but this issue is specifically about the TTS auto-reply pipeline, not the
messagetool
Environment
- OpenClaw version: 2026.3.1
- Channel: Matrix (Element Web/Desktop)
- TTS provider: OpenAI-compatible (custom endpoint)
Impact
- Affected: All Matrix users receiving TTS auto-replies
- Severity: Medium — voice reply works but UX is poor (file download vs inline playback)
- Frequency: 100% for Matrix TTS replies