I am experimenting with an DFPlayer Mini MP3 module. I got it working and I can play one song. But here is the thing: I want to play multiple songs after each other. So first track 1 then track 2 and so on.
What happens is that track one playes for one second and then track two starts and plays for one second. And so on for next tracks.
After each play command, you have delay(1000), playing the track for one second which is 1000miliseconds, and then it goes to the next track and does the same. From looking at this code it looks like it's doing what you described. Were you hoping that it would play the entire track? If so you will need to get rid of the delay commands and determine a way of detecting when it has reached the end of the track to move to the next.
I took a quick look at the library and I see a function "isPlaying()". If you want the full track to play, try adding a test after calling play, that will check if the track is still playing. When the track is no longer playing, then you could call a delay(1000) if you want one second of silence before going to the next track
Thank you LanGenz. Indeed I added a delay with the idea of having a pause between two tracks. No delay at all makes that the script runs so fast that no sound is audible.
I will go and try playing with the isPlaying function. If anyone has other information, please let me know.