Skip to content

Add pause/resume for locked voice message recording#6251

Draft
bmaximuml wants to merge 1 commit into
signalapp:mainfrom
bmaximuml:feature/voice-message-pause-resume
Draft

Add pause/resume for locked voice message recording#6251
bmaximuml wants to merge 1 commit into
signalapp:mainfrom
bmaximuml:feature/voice-message-pause-resume

Conversation

@bmaximuml
Copy link
Copy Markdown

@bmaximuml bmaximuml commented May 9, 2026

First time contributor checklist

Contributor checklist

  • My commits are rebased on the latest main branch
  • My commits are in nice logical chunks
  • My contribution is fully baked and is ready to be merged as is
  • I have tested my contribution on these devices:
  • Requires device testing with microphone access (not testable in this environment)

Description

Adds a Pause button to the locked voice message recording UI (the state entered after swiping up on the mic button). Requested by the community: https://community.signalusers.org/t/pause-while-recording-voice-message/3357

How it works:

  • After locking a recording, a "Pause" button appears alongside the existing "Cancel" button
  • Tapping Pause freezes the duration timer and pauses the AVAudioRecorder; the button label switches to "Resume"
  • Tapping Resume continues recording from the same point; the timer resumes from the correct elapsed time
  • The Send button remains active in both locked and paused states
  • Device sleep blocking is released on pause and re-acquired on resume

Implementation notes:

  • AVAudioRecorder.pause() / .record() handle the audio layer natively; no audio segments need to be stitched together
  • AVAudioRecorder.currentTime correctly excludes paused periods, so the minimum-duration check and final file duration are accurate
  • The UI timer is stopped while paused; on resume voiceMemoPausedDuration is used to offset the elapsed-time calculation so the label picks up exactly where it left off
  • New .recordingPaused case added to VoiceMemoRecordingState; all existing gesture-handler switch statements updated accordingly

Files changed:

  • VoiceMessageInProgressDraftisPaused, pauseRecording(), resumeRecording()
  • ConversationInputToolbar.recordingPaused state, Pause/Resume button in lockVoiceMemoUI(), timer helpers, adjusted duration label
  • ConversationViewController+VoiceMessagepauseRecordingVoiceMessage(), resumeRecordingVoiceMessage()
  • ConversationViewController+ConversationInputToolbarDelegatevoiceMemoGestureDidPause(), voiceMemoGestureDidResume()
  • Localizable.strings — 4 new strings (Pause, Resume + accessibility labels)
  • VoiceMessageInProgressDraftTest — unit tests for initial state and stop-before-start safety

🤖 Generated with Claude Code

When recording is locked (user swipes up on the mic button), a Pause
button now appears alongside Cancel. Tapping it pauses the recording
and changes the button to Resume; tapping again continues from the same
point. The send button remains accessible while paused.

AVAudioRecorder.pause()/record() handle the audio layer. The duration
label freezes correctly while paused by tracking accumulated pause time
separately from wall-clock elapsed time. Device sleep blocking is
released on pause and re-acquired on resume, consistent with how the
existing lock/unlock flow works.

Closes https://community.signalusers.org/t/pause-while-recording-voice-message/3357

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bmaximuml bmaximuml marked this pull request as draft May 9, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant