DFRobot / DFRobot_DF1201S

Here comes the DFPlayer Pro-a mini simple but powerful MP3 Player! This MP3 player module supports four controlling modes: Arduino, AT command, on-board buttons, and ADKEY. You can directly press the on-board button to play or switch music without using a controller. By using a USB cable, you can easily copy your favorite songs into this module to play them any where you want, or use it as a sound card for your PC or Raspberry Pi after connecting them together.
MIT License
6 stars 5 forks source link

isPlaying() function causes delay #13

Open sbarabe opened 3 months ago

sbarabe commented 3 months ago

Hi there,

I'm trying to use isPlaying() function to know if the player is playing the file, just like this: bool playing = DF1201S.isPlaying();

Unfortunatly, this function cause a delay of about a second in the sketch loop. This is inconvenient because others elements are delayed, so the use of the isPlaying() function is not acceptable.

Is there a way to fix that ? I've look into the libray and there is a 2000ms delay in the isPlaying() function. It not really a driect output from the module, but a comparison of curTime before and after the delay.

I've seen other uses of the AC6925A, some of them have a query command for playback status, would it be possible with the DFPlayer Pro via AT command ?

For reference: image

Thank you !