audioplayers
audioplayers copied to clipboard
setPlaybackRate misfunction
EVERYTHING IN FLUTTER DOCTOR IS OK
Steps to reproduce:
1. Set the button:
FlatButton(
onPressed: () {
advancedPlayer.setPlaybackRate(playbackRate: 1.2);
},
child: Text(
"X1.2",
style: TextStyle(fontSize: 15.0),
),
),
2. A listener on PlayerStateChanged
advancedPlayer.onPlayerStateChanged
.listen((AudioPlayerState s) => {setState(() => status.value = s)});
3. Call Pause() to pause the playing (AudioPlayerState = PAUSED)
4. Click the rate button (Audio is start playing but the AudioPlayerState still eqs to PAUSED)
Result:
The setPlaybackRate applied succesfuly, but the AudioPlayerState still unchanged.
Expectation:
The setPlaybackRate should not start playing a paused audio.
If AudioPlayer is Playing, it should applies the rate and keep playing If AudioPlayer is Paused or Stopped, it should applies the rate setting but Not start playing the audio. If by design the setPlaybackRate function will start playing a paused audio, it should also change the AudioPlayerState = Playing
This is indeed a bug, when converting the code to swift I also noticed this.
@RaistlinTAO Can you check, is this still a thing with 1.x.x? Thx :) I cannot test for ios, unfortunately.