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

[BUG]: Duration is zero in SoundRecorderUI.onStopped() #670

Open
sarbogast opened this issue May 1, 2021 · 2 comments
Open

[BUG]: Duration is zero in SoundRecorderUI.onStopped() #670

sarbogast opened this issue May 1, 2021 · 2 comments

Comments

@sarbogast
Copy link

Flutter Sound Version : 8.1.1

  • FULL or LITE flavor ? FULL

  • Important: Result of the command : flutter pub deps | grep flutter_sound

|-- flutter_sound 8.1.1
| |-- flutter_sound_platform_interface 8.1.1
| |-- flutter_sound_web 8.1.1
| | |-- flutter_sound_platform_interface...


Severity

  • Result is not what expected

Platforms you faced the error

  • iOS, on both an emulator and a real device

Describe the bug

In the example app, when I add an onStopped callback on SoundRecorderUI to inspect the RecordedAudio when recording is over, I get a zero duration.

To Reproduce
Steps to reproduce the behavior:

  1. In flutter_sound/example/lib/widgetUI/demo_util/demo3_body.dart
  2. line 147, where SoundRecorderUI is initialized
  3. Replace with the following code:
SoundRecorderUI(
              track,
              onStopped: (audio) {
                print(audio.duration);
              },
            ),

And whether I run the example app on an iOS emulator or on a real iPhone, duration is always 0:00:00.000000, even though I can play back the recording and it's a few seconds long. So either I don't understand the purpose of RecordedAudio.duration or there is something weird happening.


Logs!!!!

(This is very important. Most of the time we cannot do anything if we do not have information on your bug)

flutter: FS:---> openAudioSession
flutter: ---> openAudioSession
flutter: Resetting flutter_sound Recorder Plugin
@resetPlugin
iOS: ---> resetPlugin
iOS: <--- resetPlugin
@openRecorder
IOS:--> setAudioFocus
IOS:--> initializeFlautoPlayer
flutter: FS:---> openAudioSession
@Recorder status : 0
IOS:<-- setAudioFocus
@Recorder status : 0
@Recorder status : 0
flutter: <--- openAudioSession
flutter: ---> openRecorderCompleted: true
flutter: <--- openRecorderCompleted: true
flutter: ---> openAudioSession
flutter: FS:<--- openAudioSession
flutter: FS:---> openAudioSession
flutter: Resetting flutter_sound Player Plugin
iOS: ---> resetPlugin
iOS: <--- resetPlugin
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
flutter: FS:---> channelMethodCallHandler : openPlayerCompleted
flutter: ---> openPlayerCompleted: true
flutter: <--- openPlayerCompleted: true
flutter: FS:<--- channelMethodCallHandler : openPlayerCompleted
flutter: FS:<--- openAudioSession
flutter: FS:---> isDecoderSupported
flutter: FS:---> needToConvert
flutter: FS:<--- needToConvert
IOS:--> isDecoderSupported
IOS:<-- isDecoderSupported
flutter: FS:<--- isDecoderSupported
flutter: FS:---> openAudioSession
flutter: ---> openAudioSession
@openRecorder
IOS:--> setAudioFocus
IOS:--> initializeFlautoPlayer
@Recorder status : 0
IOS:<-- setAudioFocus
@Recorder status : 0
@Recorder status : 0
flutter: FS:---> openAudioSession
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
flutter: FS:---> openAudioSession
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
flutter: FS:---> openAudioSession
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:--> initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
IOS:<-- initializeFlautoPlayer
flutter: <--- openAudioSession
flutter: ---> openRecorderCompleted: true
flutter: <--- openRecorderCompleted: true
flutter: FS:<--- openAudioSession
flutter: FS:---> channelMethodCallHandler : openPlayerCompleted
flutter: ---> openPlayerCompleted: true
flutter: <--- openPlayerCompleted: true
flutter: FS:<--- channelMethodCallHandler : openPlayerCompleted
flutter: FS:<--- openAudioSession
flutter: FS:---> setSubscriptionDuration
IOS:--> setSubscriptionDuration
flutter: FS:---> channelMethodCallHandler : openPlayerCompleted
IOS:--> setSubscriptionDuration
IOS:<-- setSubscriptionDuration
flutter: ---> openPlayerCompleted: true
IOS:<-- setSubscriptionDuration
flutter: <--- openPlayerCompleted: true
flutter: FS:<--- channelMethodCallHandler : openPlayerCompleted
flutter: FS:<--- openAudioSession
flutter: FS:---> setSubscriptionDuration
IOS:--> setSubscriptionDuration
IOS:--> setSubscriptionDuration
flutter: FS:---> channelMethodCallHandler : openPlayerCompleted
IOS:<-- setSubscriptionDuration
flutter: ---> openPlayerCompleted: true
IOS:<-- setSubscriptionDuration
flutter: <--- openPlayerCompleted: true
flutter: FS:<--- channelMethodCallHandler : openPlayerCompleted
flutter: FS:<--- openAudioSession
flutter: FS:---> setSubscriptionDuration
IOS:--> setSubscriptionDuration
IOS:--> setSubscriptionDuration
flutter: FS:<---- setSubscriptionDuration
IOS:<-- setSubscriptionDuration
IOS:<-- setSubscriptionDuration
flutter: FS:<---- setSubscriptionDuration
flutter: FS:<---- setSubscriptionDuration
flutter: FS:---> setSubscriptionDuration
@Recorder status : 0
flutter: FS:<--- setSubscriptionDuration
flutter: FS:---> startRecorder
flutter: FS:---> _startRecorder.
flutter: Calling instance.startRecorder
@Recorder status : 2
@Recorder status : 2
flutter: ---> startRecorderCompleted: true
flutter: <--- startRecorderCompleted: true
flutter: FS:<--- _startRecorder.
flutter: FS:<--- startRecorder
flutter: FS:---> stopRecorder
flutter: FS:---> stopRecorder
flutter: FS:---> stop
iOS ---> stopRecorder
iOS: ---> stopRecorder (FlautoRecorder)
iOS: ---> stop (flautoRecorder)
iOS: <--- stop (flautoRecorder)
@Recorder status : 0
iOS: <--- stopRecorder (FlautoRecorder)
@Recorder status : 0
iOS <--- stopRecorder
flutter: ---> stopRecorderCompleted: true
flutter: <---- stopRecorderCompleted: true
flutter: FS:<--- stop
flutter: FS:<--- stopRecorder : /Users/sarbogast/Library/Developer/CoreSimulator/Devices/4B872759-133F-442D-8ACB-EBE9526C784A/data/Containers/Data/Application/0C9B0EB8-4862-4C87-ADD6-2EF4D0B9D57D/Library/Caches/603f4fa7-a4eb-4bf4-9c82-454549b03a44.aac
flutter: FS:<--- stopRecorder
flutter: 0:00:00.000000

@vishnuagbly
Copy link

@sarbogast did you find any fix for this?

Copy link

This issue is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days.

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

No branches or pull requests

3 participants