Help with a Halloween Project using dfplayer module

Im very new to the arduino and i am trying to set up a project for halloween and am having lots of problems.
The parts i am using are: A nano, a dfplayer, a remote and ir receiver, leds and a speaker.

I am trying to make it if i press 1 on the remote the lights go on
If i press 2 on the remote it plays a mp3 sound
If i press 3 on the remote it plays a different mp3 sound
and so on and so on

Ive been able to get the leds to work with the remote but have had no luck with the sound. Ive searched over the net and basically tried to piece things together but its only made things worse.

If anyone could help it would be really appreciated

I have attached the working code for the lights

#include <IRremote.h>
#include <SoftwareSerial.h>

 
int IR_Recv = 9;   //IR Receiver Pin 3
int bluePin = 8;
//int greenPin = 9;
//int yellowPin = 8;
 
IRrecv irrecv(IR_Recv);
decode_results results;
 
void setup(){
  Serial.begin(9600);  //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
  pinMode(bluePin, OUTPUT);      // sets the digital pin as output

}
 
void loop(){
  //decodes the infrared input
  if (irrecv.decode(&results)){
    long int decCode = results.value;
    Serial.println(results.value);
    //switch case to use the selected remote control button
    switch (results.value){
      case 4294967295: //when you press the 1 button
        digitalWrite(bluePin, HIGH);
        break;   
      case 16726215: //turns off the light when you press the Eq button
        digitalWrite(bluePin, LOW);   
        break;
    }
    irrecv.resume(); // Receives the next value from the button you press
  }
  delay(10);
  }
}

Yes, we can help. But first you must read the "how to use the forum" guide in the sticky post! You can skip points 1-6 in the guide, you got that far already.

First off WELCOME ! glad you are here.

there are a few rules, like reading HOW TO USE THIS FORUM
with attention #7 about how to post code.

and as a hint, the bottom right of your first post is... more then modify

you can edit your post, at the beginning of your code
add a bracket [ , then the word code followed by a second bracket ]
at the end of your code, do it again , this time with /code between the brackets.

one thing you will be asked is for any links to the bits you are talking about that are causing you problems

one thing you will find is that only a few people will address your post with answers to your question when your post is not on-par with the most basic rules.

but a big thumbs up for posting any code at all. that shows you are not expecting others to do your work.

Thanks for adding your code and using code tags. +1 Karma.

Next we need to see your attempt to get the DFPlayer working. Let's see the code for that, and a schematic (hand-drawn will be ok).

Here is the code that i finally came up with. Once I uploaded it to the nano the led wouldnt work as well as the sound.

Hope it helps

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

 
int IR_Recv = 9;   //IR Receiver Pin 9
int bluePin = 8;

 
IRrecv irrecv(IR_Recv);
decode_results results;
 
void setup(){
  Serial.begin(9600);  //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
  mp3_set_serial (Serial); //set Serial for DFPlayer-mini mp3 module 
  mp3_set_volume (10);
  pinMode(bluePin, OUTPUT);      // sets the digital pin as output


}
 
void loop(){
  //decodes the infrared input
  if (irrecv.decode(&results)){
    long int decCode = results.value;
    Serial.println(results.value);
    //switch case to use the selected remote control button
    switch (results.value){
      case 4294967295: //when you press the 1 button
        digitalWrite(bluePin, HIGH);
        break;   
      case 16726215: //when you press the ok button
        digitalWrite(bluePin, LOW);   
        break;
     switch (results.value){
      case 4294967295: //when you press the 2 button
        mp3_play (1); //play 0001.mp3
        break;   
     
    }
    irrecv.resume(); // Receives the next value from the button you press
  }
  delay(10);
  }
}

1.) You're using a deprecated version of the library (which probably has several bugs)
2.) Look at this library instead

You have a switch statement inside your switch statement. You should have only one switch statement.

@Power_Broker on another thread, I think I asked you about current consumption of the player in sleep mode. Did you take any readings?

Thank you @Pawn_Broker for letting me know about the updated libraries once that was updated i was able to work things out easier. Thank you @PaulRB that i had another switch in my switch statement its now been removed and everything is working well. Thanks to everyone for showing me the ropes of the forum as well.

Here is the working code, thanks again!

#include <SoftwareSerial.h> 
#include <IRremote.h>
#include <DFPlayerMini_Fast.h>

SoftwareSerial mySerial(10, 11); // RX, TX
DFPlayerMini_Fast myMP3;
 
int IR_Recv = 9;   //IR Receiver Pin 9
int bluePin = 8;
IRrecv irrecv(IR_Recv);
decode_results results;
 
void setup(){
  Serial.begin(115200);  //starts serial communication
  irrecv.enableIRIn(); // Starts the receiver
  pinMode(bluePin, OUTPUT);      // sets the digital pin as output
  Serial.begin(115200);
  mySerial.begin(9600);

  myMP3.begin(mySerial);
  
  Serial.println("Setting volume to max");
  myMP3.volume(30);
  //delay(20);
}
 
void loop() { 
  if (irrecv.decode(&results)){
   Serial.println(results.value);
    switch (results.value){
    case 16724175: //when you press the 1 button
        digitalWrite(bluePin, HIGH);
        break;   
    case 16748655: //when you press the eq button
    digitalWrite(bluePin, LOW);   
    break;
     case 16718055: //when you press the 2 button
    Serial.println("Playing track 1");
  myMP3.play(1);
  delay(5000);
  break;
  case 16743045: //when you press the 3 button
     Serial.println("Playing track 2");
  myMP3.play(2);
  delay(5000);
  break;
 }
    irrecv.resume(); // Receives the next value from the button you press
  }
  delay(10);

}

Well done! Your code could do with auto-formatting (Ctrl-T).