Skip to content

Flame Audio does not stop the AudioPlayer #1249

Locked Answered by spydon
markohrastovec asked this question in Q&A
Discussion options

You must be logged in to vote

Is the code within the if cases triggered? I wonder if this could have something to do with the methods being async and it actually created two players, but replaces the first created one with a new one in the variable? Does this happen if you do something like this in `onDragStart:

  @override
  void onDragStart(int pointerId, DragStartInfo info) async {
    if (loopPlayer == null && activeDrag.isEmpty) {
      activeDrag.add(pointerId);
      loopPlayer = await FlameAudio.audioCache.loop('sfx/flame.mp3');
    } else {
      activeDrag.add(pointerId);
    }
  }

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by spydon
Comment options

You must be logged in to vote
1 reply
@spydon
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants