Skip to content

iOS: onAudioChunks and live waveform get no data when recording again after stopping a paused recording #527

Open

Description

@yash-fadadu-simform

Describe the bug
On iOS, stopping a recording while it is paused breaks the next recording. record() succeeds and the state is recording, but onAudioChunks never fires and the live waveform stays flat. The recording after that works again, so the failures alternate: works, flat, works, flat.

To Reproduce

  1. recorderController.record(...) and listen to onAudioChunks. Chunks arrive.
  2. recorderController.pause().
  3. recorderController.stop().
  4. recorderController.record(...) again. The state is recording, but no onAudioChunks event arrives and the waveform stays flat.
  5. Repeat steps 2–4. The next recording works, the one after it is silent again, and so on.

Expected behavior
Every recording started with record() delivers onAudioChunks events, whether or not the previous one was stopped while paused.

Smartphone (please complete the following information):

  • Device: iPhone 13 simulator
  • OS: iOS 18.1
  • Version: main (2.1.0 unreleased), 16 kHz AAC, overrideAudioSession: true

Screenshots
Before and after: record → stop → record and record → pause → stop → record

Recordings that got audio (each cycle records for 1.5 s; a cycle fails when no onAudioChunks event arrives):

Scenario main
record → stop → record 10/10
record → pause → stop → record 3/6 (2nd, 4th, 6th silent)

Additional context
RecorderBytesStreamEngine keeps a paused flag that pause() and resume() toggle. stop() (detach()) never resets it. Stopping while paused leaves the flag true, so the next recording's input tap drops every buffer. Pausing that silent recording toggles the flag back to false, which is why the one after it works.

macOS is not affected: its recorder sets isPaused explicitly and clears it on start and stop.

Related: #505 reports the same symptom after record → stop → record, but that sequence didn't reproduce here (10/10), so this is tracked separately.

Resolved by #521.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions