play the second music after the first music is finished
Hello, I want the second music to play after the first music plays completely under one condition. How can I do that?
I have one more question. I have two buttons and when I press the first button I want to play the first music and when I press the second button I want to mute the first music and play the second song.
if (verilerim[0] == 1 && !player.isPlaying()) { player.play(1); delay(100); player.play(2); } else if (verilerim[1] == 1 && player.isPlaying()){ player.play(1); stop(); player.play(3); }
To play one after another, you can use the BUSY pin of the mp3 player. It goes LOW as long as a song is ongoing. Connect it to an input_pullup pin and check it's state while playing to manage the execution of your code.