need to play 1 mp3 but code plays all

Hi. I'm wondering

  1. why it needs to include mp3_next () command to play 1 file ex: 0001.mp3 from all files saved in the SDcard in a given instance?
  2. And why the code plays the next files after each power reset?

My goal is to play 0001.mp3 at a given time. Then 0003.mp3 on another instance. I don't want to play them all at once. I just want to select a file which I like via coding (no using of trigger button)

Can somebody correct the code below?

#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>

int N = 1;
int runXTimes = 0;


void setup ()
{
Serial.begin (9600);
mp3_set_serial (Serial); //set Serial for DFPlayer-mini mp3 module
mp3_set_volume (10);


}
void loop()
{
 if (runXTimes < N)
 {
mp3_play (1);
mp3_next ();
delay (2000);

  runXTimes++;
 }
 
}
//and on another instance play 0007.mp3

void loop()   // By the way what word should I put as replace,ent for the 2nd void loop?
{
 if (runXTimes < N)
 {
mp3_play (7);
mp3_next ();
delay (2000);

  runXTimes++;
 }
 
}
  1. why it needs to include mp3_next () command to play 1 file ex: 0001.mp3 from all files saved in the SDcard in a given instance?

Does it need that command? I don't have that module but the documentation (it was your duty to provide that link!) says that the mp3_play(nr) should be sufficient to play that file.

  1. And why the code plays the next files after each power reset?

What's a power reset? A power cycle? Or do you use more power to push the reset button?

I guess you should ask these questions the manufacturer of the module. They know what they programmed into their module. The source code of the firmware is not opened and the documentation is quite sparse.

Hi. Please help revise the code below code to play specific mp3 files without playing all.
I have 20 short voice files saved in SD card.

#include <DFPlayer_Mini_Mp3.h>
#include <SoftwareSerial.h>


const int buzzer = 12; // Speaker
        

void setup() 
{ 

 Serial.begin (9600);
 mp3_set_serial (Serial); 
 mp3_set_volume (15);
 mp3_play ();
 }
 
void CheckTank() {
   
}
void CheckTank() 
  Serial.println("CheckTank");

  void Buzzer();
  mp3_play (5); //play 0005.mp3 Check Tank voice sound
  delay (1000);
  mp3_next ();
  delay (1000);
  mp3_prev ();
  delay (1000);
  mp3_play (20);
  delay (1000);

}

void CheckTemp() {
  Serial.println("CheckTemp");
    void Buzzer();
  mp3_play (2);// play 0002.mp3 CheckTemp voice file
  delay (1000);
  mp3_next ();
  delay (1000);
  mp3_prev ();
  delay (1000);
  mp3_play (20);
  delay (1000);

}

My problem is: the below modification just doesn't work:

void CheckTemp() {
  Serial.println("CheckTemp");
    void Buzzer();
  mp3_play (2);// play 0002.mp3 CheckTemp voice file
  delay (1000);


}

Why not continuing your original thread?

I can't finish it, that's why I've changed to a simpler one.