audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

setPlaybackRate misfunction

Open RaistlinTAO opened this issue 4 years ago • 2 comments

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

RaistlinTAO avatar Mar 25 '20 07:03 RaistlinTAO

This is indeed a bug, when converting the code to swift I also noticed this.

luanpotter avatar Nov 22 '20 02:11 luanpotter

@RaistlinTAO Can you check, is this still a thing with 1.x.x? Thx :) I cannot test for ios, unfortunately.

Gustl22 avatar Sep 03 '22 09:09 Gustl22