question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]: Flutter Sound logger

See original GitHub issue

Flutter Sound Version : 8.0.0+6

  • FULL or LITE flavor ? ->Full

  • Important: Result of the command : flutter pub deps | grep flutter_sound Dart SDK 2.12.1 Flutter SDK 2.0.2 coupled 1.2.0+023

|-- flutter_sound 8.0.0+6 | |-- flutter… | |-- flutter_sound_platform_interface 8.0.0+6 | | |-- flutter… | | |-- meta… | | '-- plugin_platform_interface… | |-- flutter_sound_web 8.0.0+6 | | |-- flutter… | | |-- flutter_sound_platform_interface… | | |-- flutter_web_plugins… | | |-- js… | | '-- meta… | |-- flutter_spinkit 5.0.0 | | '-- flutter… | |-- logger 1.0.0 | |-- path… | |-- path_provider… | |-- provider 5.0.0 | | |-- collection… | | |-- flutter… | | '-- nested 1.0.0 | | '-- flutter… | |-- recase 4.0.0-nullsafety.0 | |-- synchronized 3.0.0 | '-- uuid 3.0.3

'-- crypto…

Severity

  • Result is not what expected ?
  • Minor issue ?

Platforms you faced the error

Emulator Android Pixel 3A


Describe the bug When declaring StreamSubscription, player.onProgress.listen not triggering functions

To Reproduce playerSubsciption = player.onProgress!.listen((e){ double progress = e.duration.inMilliseconds.toDouble(); \Not triggering this } ) Full Code: https://pastebin.com/c9Wmkcgq

Logs!!!

No logs presented since it did not do anything.


Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
osaxmacommented, Apr 10, 2021

You need to set the update frequency before starting the player such as:


await player.setSubscriptionDuration(const Duration(milliseconds: 100); // <~~ this is necessary 
await player.startPlayer(.....);

// from here on, you can listen to updates at whatever frequency you set above
playerSubsciption = player.onProgress!.listen((e) {
    double progress = e.duration.inMilliseconds.toDouble(); 
    }
  );
3reactions
funyincommented, May 31, 2021

This is a very wonderful package, thanks a lot. Please add this to the documentation or fix it. I had to beat around till I found it plus the documentation says the subscriptionDuration is already 100 by default which is not the case.

You need to set the update frequency before starting the player such as:

await player.setSubscriptionDuration(const Duration(milliseconds: 100); // <~~ this is necessary 
await player.startPlayer(.....);

// from here on, you can listen to updates at whatever frequency you set above
playerSubsciption = player.onProgress!.listen((e) {
    double progress = e.duration.inMilliseconds.toDouble(); 
    }
  );

with that answer, I think you can close this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Recorder not working · Issue #517 - GitHub
Flutter Sound Version : Released version Version number 6.4.2+1 FULL Result of the command "flutter pub deps | grep flutter_sound" (very ...
Read more >
flutter_sound | Flutter Package - Pub.dev
... api for audio playback and recording. Audio player, audio recorder. ... Flutter Sound is a Flutter package allowing you to play and...
Read more >
No such file or directory recording audio using Flutter Sound
I'm trying to record audios in my app but I'm getting this error. Caused by: com.google.android.exoplayer2.upstream.
Read more >
Audio - Flutter Awesome
Flutter app with just_audio package for bug review · Audio ... A Flutter package for both android and iOS which provides Audio recorder...
Read more >
Flutter logging best practices - LogRocket Blog
To avoid this, log appropriate information to determine the root cause of the error in developer code without extending the same chain down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found