Skip to content

Feature: Add voice message recording and sending in chat #27

@mjkatgithub

Description

@mjkatgithub

Goal

Enable users to record audio messages directly in chat and send them as
voice messages.

Scope

  • Add microphone recording control in message input (start/pause/stop/cancel).
  • Request and handle microphone permissions with clear user feedback.
  • Show recording state and duration while capturing audio.
  • Generate a preview before sending (playback + delete option).
  • Upload recorded audio using existing media upload flow.
  • Send uploaded recording as a chat audio message with metadata.
  • Render voice messages in timeline with playback controls.
  • Handle error states (permission denied, recording failed, upload failed).
  • Add/extend unit, integration, and E2E tests.

Branch

feature/voice-message-recording

Acceptance Criteria

  • User can start and stop recording from message input.
  • Permission flow is handled gracefully (allow/deny).
  • User can preview and remove recording before sending.
  • Recorded voice message uploads and sends successfully.
  • Sent voice message appears in timeline and is playable.
  • Recording/upload/send failures show clear error feedback.
  • Existing text/image/video flows remain unaffected.

Test Checklist

Unit

  • Recording state machine (idle/recording/preview/sending/error).
  • Permission-denied and recording-failure handling.
  • Voice message payload creation from recorded blob.

Integration

  • Recorded blob upload returns media URL/metadata correctly.
  • Chat send flow publishes playable voice message event.
  • Error mapping from upload/send to UI messages.

E2E

  • User records, previews, and sends a voice message in a room.
  • Receiver sees and plays the voice message.
  • Permission denied path shows actionable feedback.

Notes

  • This issue is only for recording in-app via microphone.
  • Audio file picker from device storage is out of scope (separate feature).

Protocol/Compatibility Notes (Matrix)

  • Send as m.room.message audio event for broad compatibility.

  • Include sufficient audio metadata (mimetype, size, duration if known).

  • For voice recordings, include voice-message specific markers where supported.

  • Always provide fallback rendering as regular audio (m.audio) for clients
    without voice-message UI support.

  • Verify behavior against at least one modern Matrix client and one older/basic
    client rendering path.

  • If voice-specific fields are unsupported by the receiving client, message must
    still be playable as a normal audio attachment.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions