r/ArduinoHelp • • 1h ago

Trouble playing mp3 files on aDFPlayer - Mini MP3 Player

Below is a small part of an Arduino sketch to play 3 files through a DFPlayer. The files play so everything is hooked up correctly. The problem is the files play 2 then 3 then 1. Out of order. Any idea why?

  
  myDFPlayer.volume(5);  //Set volume value. From 0 to 30 
{

myDFPlayer.play(1);  //Play the first mp3

  delay(10000);

  myDFPlayer.play(2);  //Play the second mp3

  delay(10000);

  myDFPlayer.play(3);  //Play the third mp3

}

void loop()

1 Upvotes

3 comments sorted by

1

u/imseakin 1h ago

The files are INDEXED based upon the ORDER THE FILES WERE COPIED TO THE MICROSD CARD. it is not based on their alphabetical file name.

Reformat the card and copy the files over in the order you want and you’ll see it will likely work as you expect.

I’ve fallen into that DFPlayer trap myself.

Good luck.

1

u/Idaho-Tom 22m ago

Who knew? In everything I've read it never mentioned it plays in the order loaded onto the card. Reformatted, loaded in the proper sequence and it plays correctly..

Thanks for the help.

1

u/nixiebunny 1h ago

What OS was used to build the SD card? I had problems using a Mac because it makes extra hidden files. Also, did you copy the files in the desired order onto a freshly formatted card?