Skip to content

Looping/repeating track on AudioPlayer #481

Answered by lanewinfield
lanewinfield asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out after lots of playing.

First, had to set setAutoNext to false:

  // setup player
  player.begin();
  player.setVolume(1);
  player.setAutoNext(false);

Then had to stop and begin again:

  if(player.isActive() == true) {
    Serial.println("we're active!");
  } else {
    Serial.println("trying to play...");
    player.stop();
    player.setAudioSource(source);
    player.begin();
    player.setVolume(1);
    player.setAutoNext(false);
  }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lanewinfield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant