Hold-to-record voice messages (microphone button) #15

Open
opened 2026-10-05 16:07:46 +00:00 by robocub · 0 comments
Owner

Why

"Hold down to record a voice message" is a standard button in Telegram, WhatsApp, Discord mobile, Element and FluffyChat. Testers named it as the biggest missing UI piece in Commet.

What exists

  • No recording at all: nothing in the client captures audio for messages, and there's no recording package in pubspec.yaml.
  • Playback: received audio files play through the generic attachment player (message_attachment.dart → AudioPlayer, media_kit), but they're shown as audio files, not as voice messages (no waveform, no duration).

How Matrix clients send voice messages

An m.room.message with msgtype: m.audio, the file as Ogg/Opus (audio/ogg), info.duration in ms, plus:

  • "org.matrix.msc3245.voice": {}: marks it as a voice message;
  • "org.matrix.msc1767.audio": {"duration": <ms>, "waveform": [0..1024, …]}: duration and a waveform for the bubble.
    Element, FluffyChat and others render these as voice bubbles. Sending the same shape keeps us compatible both ways.

Plan

  1. Composer button: a microphone button in place of the send button while the text field is empty.
    • Mobile: press and hold to record, release to send, slide left to cancel, slide up to lock and record hands-free.
    • Desktop: click to start, then a bar with timer, cancel and send.
  2. Recording: Opus in Ogg at ~24–32 kbps mono; level sampling during recording builds the waveform (downsampled to ~100 values). Per platform: Android native recorder; Linux via PipeWire/PulseAudio (must work inside the Flatpak: needs the --socket=pulseaudio permission, which the manifest already has); Windows native. Candidate: the record package. Check its Linux backend doesn't depend on an external CLI that the Flatpak lacks.
  3. Sending with the MSC3245/MSC1767 fields above, as a reply when replying.
  4. Playback: render incoming voice messages (any m.audio with org.matrix.msc3245.voice) as a voice bubble: play/pause, waveform with progress, duration, playback speed (1×/1.5×/2×).
  5. Microphone permission prompts on Android; graceful error if no mic.

Acceptance

Hold the mic button on Android, say something, release: Element shows a voice message with a waveform and plays it. Same from Linux (Flatpak) and Windows via click-to-record. Voice messages from Element show as voice bubbles in Vommet.


Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker.

## Why "Hold down to record a voice message" is a standard button in Telegram, WhatsApp, Discord mobile, Element and FluffyChat. Testers named it as the biggest missing UI piece in Commet. ## What exists - **No recording at all**: nothing in the client captures audio for messages, and there's no recording package in `pubspec.yaml`. - **Playback**: received audio files play through the generic attachment player (`message_attachment.dart` → `AudioPlayer`, media_kit), but they're shown as audio *files*, not as voice messages (no waveform, no duration). ## How Matrix clients send voice messages An `m.room.message` with `msgtype: m.audio`, the file as **Ogg/Opus** (`audio/ogg`), `info.duration` in ms, plus: - `"org.matrix.msc3245.voice": {}`: marks it as a voice message; - `"org.matrix.msc1767.audio": {"duration": <ms>, "waveform": [0..1024, …]}`: duration and a waveform for the bubble. Element, FluffyChat and others render these as voice bubbles. Sending the same shape keeps us compatible both ways. ## Plan 1. **Composer button**: a microphone button in place of the send button while the text field is empty. - Mobile: press and hold to record, release to send, slide left to cancel, slide up to lock and record hands-free. - Desktop: click to start, then a bar with timer, cancel and send. 2. **Recording**: Opus in Ogg at ~24–32 kbps mono; level sampling during recording builds the waveform (downsampled to ~100 values). Per platform: Android native recorder; Linux via PipeWire/PulseAudio (must work inside the Flatpak: needs the `--socket=pulseaudio` permission, which the manifest already has); Windows native. Candidate: the `record` package. Check its Linux backend doesn't depend on an external CLI that the Flatpak lacks. 3. **Sending** with the MSC3245/MSC1767 fields above, as a reply when replying. 4. **Playback**: render incoming voice messages (any `m.audio` with `org.matrix.msc3245.voice`) as a voice bubble: play/pause, waveform with progress, duration, playback speed (1×/1.5×/2×). 5. Microphone permission prompts on Android; graceful error if no mic. ## Acceptance Hold the mic button on Android, say something, release: Element shows a voice message with a waveform and plays it. Same from Linux (Flatpak) and Windows via click-to-record. Voice messages from Element show as voice bubbles in Vommet. --- _Filed with LLM assistance. This is a fork-only issue; never refile it on Commet's tracker._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
robocub/vommet#15
No description provided.