DF player to play sound on button press/position

Do you have you a micro SD card with a mp3 directory in the root?
Do you have your sounds (mp3 files) in files in the mp3 directory?
Are the sound (mp3) files named 0001.mp3, 0002.mp3, 0003.mp3, etc.

What is a "flick switch"? In my 50+ years of electronics that is a new term for me.

If you want a sound to play on power up, put the play in setup() (see example code).

This example will play the sound in file mp3\0003.mp3 at startup and sound mp3\0002.mp3 once each time the button (pin 8) is pressed. Tested on real hardware.

The code makes use of the state change detection method. The button is wired to ground as shown in my state change detection for active low inputs tutorial. Wiring so the switch is active LOW is more accepted practice.

//#include <Arduino.h>
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

const byte buttonPin = 8;

SoftwareSerial ss(4, 5); // RX, TX
DFRobotDFPlayerMini myDFPlayer;

void setup()
{
   Serial.begin(115200);
   ss.begin(9600);

   pinMode(buttonPin, INPUT_PULLUP);

   Serial.println();
   Serial.println(F("DFRobot DFPlayer Mini play at startup"));

   if (!myDFPlayer.begin(ss))    //Use softwareSerial to communicate with mp3.
   {
      Serial.println(F("Unable to begin:"));
      Serial.println(F("1.Please recheck the connection!"));
      Serial.println(F("2.Please insert the SD card!"));
      while (true)  // wait forever
      {
         delay(0); // Code to compatible with ESP8266 watch dog.
      }
   }
   Serial.println(F("DFPlayer Mini online."));

   myDFPlayer.volume(25);  //Set volume value. From 0 to 30
   myDFPlayer.play(3);  //Play the 0003.mp3
}

void loop()
{
   static bool lastButtonState = HIGH;
   static unsigned long timer = 0;3
   unsigned long interval = 50;
   if (millis() - timer >= interval)
   {
      timer = millis();
      bool buttonState = digitalRead(buttonPin);
      if (buttonState != lastButtonState)
      {
         if (buttonState == LOW)
         {
            myDFPlayer.play(2);  //Play the 0002.mp3
         }
         lastButtonState = buttonState;
      }
   }
}

The ZAPSPLAT site is a great source for free sounds.