Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Alarm Pauses Recording, but Recorder Incorrectly Reporting Continuous Recording #372

Closed
erdnx opened this issue Jul 25, 2024 · 1 comment
Labels
bug Something isn't working iOS

Comments

@erdnx
Copy link

erdnx commented Jul 25, 2024

5.1.2

Environment

  • IOS

Describe the bug

When an interruption occurs (alarm, phone call, etc.), the internal recorder pauses, but this package's recorder assumes it is still recording. When you pause and resume recording, it actually continues to record. The problem is that the package's recorder reports the wrong state. It reports that it is recording while it is actually paused.

To Reproduce

Steps to reproduce the behavior:

  1. Start record
  2. Alarm rings
  3. Recorder showing as it is still recording
  4. Save record
  5. Listen it, there is nothing after the alarm

Expected behavior

When an interruption happen, it may be alarm, phone call or other media action, recorder should be aware what is the actual state of recorder.

@llfbandit llfbandit added bug Something isn't working iOS labels Jul 25, 2024
@mynlexi
Copy link

mynlexi commented Jul 28, 2024

This can be catched by doing a check for incoming data

void addAudioData(Uint8List audioData) {
    _buffer.add(audioData);
    _resetInactivityTimer();
  }

  void _resetInactivityTimer() {
    _inactivityTimer?.cancel();
    // pausing?
    _inactivityTimer = Timer(Duration(milliseconds: inactivityTimeout), () {
      getIt<RecorderBloc>()
          .add(SpawnRecorderError(RecorderError.bluetoothError));
    });
  }

-> on alarm u can just pause, and resume, by user input
-> audio source change (eg. bluetooth) pauses, but resume doesnt work (probably would have to create new recorder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
None yet
Development

No branches or pull requests

3 participants