I moved your topic to an appropriate forum category @vishwjeet123
In the future, when creating a topic please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
Why did you choose to not use the Arduino IDE setup() and loop() code?
Last time I ran DFPlayer Mini (project interrupted by COVID and moving house, code ... better to use what is forum-archived here) I used Arduino IDE setup() and loop() with Serial to Serial Monitor interface and software serial to the player. That let me read the messages the player sent back and not need esoteric means to access the player.
There is a library according to links I saw in a web search.
There are docs for the player including how to run it stand-alone with buttons and what buttons can do, Arduino IO pins can do for simple things like you want.
I dunno why you chose to go the route you did. Maybe that's what you're used to or maybe it's what you found on the net. The difference means a lot as to what you do now.
I Run DF mini player Arduino also, here is run smoothly but i make a project on Atmega32 and wanted to add DF mini player on ATmega32 DF mini player didn't play
It is possible to program a standalone ATmega32 with Arduino IDE if you bootload it or use ISCP pins, not that you have to but if you do then you can use your code that runs smoothly with changes for pin numbers.
I am using Code Vision AVR as a compiler, and my microcontroller is ATmega32. I don't want to use Arduino as a programmer because I am using a USBasp programmer for ATmega32.