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

Duration doesn't reset after calling stop (IOS) #74

Closed
Flajt opened this issue Jul 31, 2022 · 4 comments · Fixed by #75
Closed

Duration doesn't reset after calling stop (IOS) #74

Flajt opened this issue Jul 31, 2022 · 4 comments · Fixed by #75
Labels
bug Something isn't working

Comments

@Flajt
Copy link

Flajt commented Jul 31, 2022

Hello, first of all thank you for this great package.

If I call recoderController.stop() and try to take a new recording without leaving the page (and triggering dispose), it will start by first displaying no wave. If one has the duration markers enabled, one can see that it renders the last timestamp at the near the left most position.

Video of the issue
Audio_issue.mp4

Device: Iphone 12 mini
IOS version: 15.6
Flutter Version: 3.0.4
package version: 0.1.3

Edit: No clue if the issue also is on android

Code snippet for my recording button:

class RecordingButton extends StatefulWidget {
  const RecordingButton(
      {Key? key, required this.controller, required this.audioManager})
      : super(key: key);
  final RecorderController controller;
  final AudioManager audioManager;
  @override
  _RecordingButtonState createState() => _RecordingButtonState();
}

class _RecordingButtonState extends State<RecordingButton> {
  bool isRecording = false;
  @override
  Widget build(BuildContext context) {
    return FloatingActionButton(
        onPressed: () async {
          isRecording = !isRecording;
          String savePath = await widget.audioManager.audioPath;
          isRecording == true
              ? await widget.controller.record(savePath)
              : await widget.controller.stop(true);
          setState(() {});
        },
        child: isRecording ? const Icon(Icons.stop) : const Icon(Icons.mic));
  }
}
@Ujas-Majithiya
Copy link
Collaborator

@Flajt Ok so what is happening here is, when you start recording the audio for second time it clears all the waves but it is not resetting the distance it pushed the first wave back and for new recording its starting from old distance.

Thanks for reporting this issue, we will soon release a fix

@Ujas-Majithiya
Copy link
Collaborator

Ujas-Majithiya commented Jul 31, 2022

@Flajt I have created a PR for the issue. You may use that branch until the next release

@Flajt
Copy link
Author

Flajt commented Jul 31, 2022

I appreciate it. Thanks a lot.

@Ujas-Majithiya
Copy link
Collaborator

Ujas-Majithiya commented Jul 31, 2022

@Flajt and everyone, if you decide to set callReset to false you will require manually calling reset() from RecorderController to clear waves when recording again

@ujas-m-simformsolutions ujas-m-simformsolutions added the bug Something isn't working label Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants