ryanheise / audio_service

Flutter plugin to play audio in the background while the screen is off.
803 stars 480 forks source link

playbackState stream returns default `speed` = 1.0 if I create a listener after starting playback. #920

Closed a-v-ebrahimi closed 2 years ago

a-v-ebrahimi commented 2 years ago

Documented behaviour

_audioHandler.playbackState.listen((p) { D("Audio playback speed ${p.speed}"); });

Actual behaviour

I set speed to 1.2 in a view, then I switched to another view and started listening to playbackState, although playback speed is heard fast (1.2), but the listener returns p.speed as 1.0

Minimal reproduction project

Official example: main.dart

Reproduction steps

Set playback speed to something, then create a listener some where else

Output of flutter doctor

[√] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19043.1586], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.6)
[√] Android Studio (version 2021.1)
[√] VS Code (version 1.65.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!

Devices exhibiting the bug

Android and Windows

ryanheise commented 2 years ago

You didn't describe any documented behaviour under "Documented Behaviour". You gave a false minimal reproduction project because main.dart doesn't have any UI to switch to another view so it is impossible for this unmodified example to reproduce your issue. You also listed coding instructions under "Reproduction steps" when the instructions for bug submission said that these should be user steps, not code. The most important problem is that I wasted 5 minutes on this improper bug report (and given that my physical limitations mean I can't sit at a computer for longer than 5 minutes, it has taken some pretty valuable time away from me).

Closing as an invalid issue (and probably not a bug, probably a misuse of the plugin.)

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service.