Fast and easy to understand Arduino library to use the DFPlayer Mini MP3 module from DFRobot.com. This is a huge improvement (both in terms of execution speed and simplicity) to the standard library provided by DFRobot.com.
If you use the playFromMP3Folder() or playAdvertisement() functions, the files to be played must be organised in an extremely precise manner. The "MP3 Folder" must be in the root of the storage device (such as a MicroSD card) and it must be called "mp3". The folder name is probably not case-sensitive. Likewise, the "Advertisement" folder used for short interruptions to main audio playback must also be in the root of the storage device, and it must be called "advert". In addition, audio filenames must be prepended by a zero-padded 4-digit number if the files are in the root or "mp3" folders. If the files are played from folders other than root or "mp3", the folder names must be zero-padded 2-digit numbers while their contents must be audio files with names prepended by a zero-padded 3-digit number.
If you are using multiple DFPlayers with SoftwareSerial, it is necessary to make your SoftwareSerial instance listen (i.e. SoftwareSerial.listen()) before calling queries such as .isPlaying() or .currentVolume().
boolbegin(Stream& stream, bool debug, unsignedlong threshold=100);
voidplayNext();
voidplayPrevious();
voidplay(uint16_t trackNum);
voidstop();
voidplayFromMP3Folder(uint16_t trackNum);
voidplayAdvertisement(uint16_t trackNum);
voidstopAdvertisement();
voidincVolume();
voiddecVolume();
voidvolume(uint8_t volume);
voidEQSelect(uint8_t setting);
voidloop(uint16_t trackNum);
voidplaybackSource(uint8_t source);
voidstandbyMode();
voidnormalMode();
voidreset();
voidresume();
voidpause();
voidplayFolder(uint8_t folderNum, uint8_t trackNum);
voidplayLargeFolder(uint8_t folderNum, uint16_t trackNum);
voidvolumeAdjustSet(uint8_t gain);
voidstartRepeatPlay();
voidstopRepeatPlay();
voidrepeatFolder(uint16_t folder);
voidrandomAll();
voidstartRepeat();
voidstopRepeat();
voidstartDAC();
voidstopDAC();
voidsleep();
voidwakeUp();
boolisPlaying();
int16_tcurrentVolume();
int16_tcurrentEQ();
int16_tcurrentMode();
int16_tcurrentVersion();
int16_tnumUsbTracks();
int16_tnumSdTracks();
int16_tnumFlashTracks();
int16_tcurrentUsbTrack();
int16_tcurrentSdTrack();
int16_tcurrentFlashTrack();
int16_tnumTracksInFolder(uint8_t folder);
int16_tnumFolders();
voidsetTimeout(unsignedlong threshold);
voidfindChecksum(stack& _stack);
voidsendData();
voidflush();
int16_tquery(uint8_t cmd, uint8_t msb=0, uint8_t lsb=0);
boolparseFeedback();
voidprintStack(stack _stack);
voidprintError();For more info: https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299


