Home › Forums › Sparkfun MP3 Shield Library Support Forum › Looping between a few tracks? › Reply To: Looping between a few tracks?
April 9, 2013 at 12:11 pm
#2382
Michael P. Flaga
Member
There was a minor typo in the above example. Where “n” is the track number you are calling.
for (int n = 0; n < 9 ; n++)
{
MP3player.playTrack(n);
while (MP3player.isPlaying());
}
And since it is called by the loop the loop “n” knows which track is playing.
More advanced one could rely on the SdFat Library to know which filename is playing. The below code is the key components for it
SdFile file;
char filename[13];
file.getFilename(filename);
But it has been awhile since I have used them. So it would take some trails to get it going. But likely not too difficult.