Skip to content

[iOS & Android] Calling stop never ends when not recording #537

@ddikman

Description

@ddikman

Package version
6.1.0

Environment

  • Android Huawei P9,
  • iPhone 8p, iOS 16.7.11

Describe the bug

On upgrading to v6.1.0 our AudioRecorder ended up deadlocking on using the AudioRecorder.

I wonder if it may be related to the introduction of the semaphores.
8d051b5#diff-583fabaf2e98a9c369810a4305a95bf57d73cd868b9eeb42117dc85648532dc7R27-R30

I found that we are calling a recorder.stop before it is actually recording and it seems this never finishes/exists.

To Reproduce

  1. Instantiate the AudioRecorder
  2. Call recorder.stop()

We are using this RecordConfig:

RecordConfig(
        encoder: AudioEncoder.pcm16bits,
        numChannels: 1,
        sampleRate: 16000,
        bitRate: 64000,
        autoGain: true,
        echoCancel: true,
        streamBufferSize: 2048,
        audioInterruption: AudioInterruptionMode.none,
      );

Expected behavior

The stop method either throws or finishes without error if not recording.

Workaround

I check the isRecording before calling stop and it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions