Forum >DFPlayer - How to avoid pauses beteween tracks
DFPlayer - How to avoid pauses beteween tracks

Hello!
I play with a dfplayer and have a question
Is it possible to play tracks without pause, like as looped track (or as a random playback mode)?
I want to make sound module for model train and need to play sound tracks smooth and without pauses (first track - engine starting sound, second track - looped engine idle sound, third track - increasing engine rpm sound etc.)
I use Arduino and serial interface. So, my program start first track and wait for answer from dfplayer (1st track is finished playing), next start second track etc. And there is a little pause between tracks...
SKU:DFR0299
IDE:Arduino 1.6.7
Library: SoftwareSerial to communicate with a dfplayer
With best regards,
Vasily
I play with a dfplayer and have a question

I want to make sound module for model train and need to play sound tracks smooth and without pauses (first track - engine starting sound, second track - looped engine idle sound, third track - increasing engine rpm sound etc.)
I use Arduino and serial interface. So, my program start first track and wait for answer from dfplayer (1st track is finished playing), next start second track etc. And there is a little pause between tracks...
SKU:DFR0299
IDE:Arduino 1.6.7
Library: SoftwareSerial to communicate with a dfplayer
With best regards,
Vasily
2016-10-30 12:06:08 With the current version of the DFPlayer, i don't believe that is possible, but best ask them direct.
These are the reasons that i am using a combination of generated sound and recorded sound for my system. still under development. You may have better luck with the other chips you have ordered.
If i understand the current range of DCC sound decoders correctly they have on-board digital sound in stored high speed memory, resulting in NO noticeable delay, but you will pay for this tech.
wl888
These are the reasons that i am using a combination of generated sound and recorded sound for my system. still under development. You may have better luck with the other chips you have ordered.
If i understand the current range of DCC sound decoders correctly they have on-board digital sound in stored high speed memory, resulting in NO noticeable delay, but you will pay for this tech.

2016-10-30 11:52:58 Tried to start next track with trigger on BUSY pin of DFPlayer. Pauses now shorter twice. So we can conclude - pauses = time for receive serial feedback + time for send serial command.
DF (or rather chipmaker) need to implement serial function for setting number of track, which will be started automatically AFTER current track will be stopped.
? Is it possible to change serial baudrate ? I have tried to change it with Serial.begin(xxxxx), but without result.
doublehead
DF (or rather chipmaker) need to implement serial function for setting number of track, which will be started automatically AFTER current track will be stopped.
? Is it possible to change serial baudrate ? I have tried to change it with Serial.begin(xxxxx), but without result.

2016-10-29 01:07:11 Checked out the videos and chip that you mentioned, downloaded some of the sketches, but they seem to have built in delays, they are not using "millis"as expected the sketches are heavily commented in Russian, but from what i can gather they are using an interrupt system, just can't get my head around it, let me know how you go with the chips, they seem to be very expensive.
have got all the basic components for the RC system and will be working on that over the next week.
Luck
wl888
have got all the basic components for the RC system and will be working on that over the next week.
Luck

2016-10-28 23:05:13 Hmm, I have not any "CLICKS" while playing. Only one - during initialization. Will playing whit this module on the next week. If I'll find something usefull I'll report it.
But I think we need to use something like vs1053b chip directly, without 3rd party software. I've already ordered a pair
About PM - Members of my forum have maked DC sound module with TMRpcm library. It simple, but may be interesting. make_clickable_callback(MAGIC_URL_FULL, '
', 'https://www.youtube.com/watch?v=dcUXwOfCe3s', '', ' class="postlink"')
src:make_clickable_callback(MAGIC_URL_FULL, ' ', 'http://scaletrainsclub.com/board/viewtopic.php?p=178438#p178438', '', ' class="postlink"')
(sorry, messages in russian, but you can translate it with google or ask me to translate)
doublehead
But I think we need to use something like vs1053b chip directly, without 3rd party software. I've already ordered a pair

About PM - Members of my forum have maked DC sound module with TMRpcm library. It simple, but may be interesting. make_clickable_callback(MAGIC_URL_FULL, '
', 'https://www.youtube.com/watch?v=dcUXwOfCe3s', '', ' class="postlink"')
src:make_clickable_callback(MAGIC_URL_FULL, ' ', 'http://scaletrainsclub.com/board/viewtopic.php?p=178438#p178438', '', ' class="postlink"')
(sorry, messages in russian, but you can translate it with google or ask me to translate)

2016-10-27 12:50:10 Sorry for the delay, I didn't get the notification.
Yep...Give it a go. I am not sure if I tried that walk around or not but I do remember that i got a definite "CLICK" at the end of a file, the solution to that was to fade out the track at the end, this helped.there will still be the reported small gap in the track as the MP3 file starts, if you can find a solution to that, well done. Yes the DFPlayer will cut off the running file when it is re-triggered if the "BUISY" pin is not connected.
No sign of the PM, just post your question here, I will check each day.
Further development....have just tested sound from the UNO thru a Phone speaker and a cheep amp, so far so good, waiting for other higher quality speakers to arrive. Using a L293D to run the motor, this has a 600mA limit but I have connected both sides in series and now should have a 1.2A control, PWM speed. I tested this on an old style HO motor (5-600mA cold start, Unloaded) and it works fine, got a little warm, but i had no heat sink on it at the time.
Still waiting on more parts.
wl888
Yep...Give it a go. I am not sure if I tried that walk around or not but I do remember that i got a definite "CLICK" at the end of a file, the solution to that was to fade out the track at the end, this helped.there will still be the reported small gap in the track as the MP3 file starts, if you can find a solution to that, well done. Yes the DFPlayer will cut off the running file when it is re-triggered if the "BUISY" pin is not connected.
No sign of the PM, just post your question here, I will check each day.
Further development....have just tested sound from the UNO thru a Phone speaker and a cheep amp, so far so good, waiting for other higher quality speakers to arrive. Using a L293D to run the motor, this has a 600mA limit but I have connected both sides in series and now should have a 1.2A control, PWM speed. I tested this on an old style HO motor (5-600mA cold start, Unloaded) and it works fine, got a little warm, but i had no heat sink on it at the time.
Still waiting on more parts.

2016-10-25 04:19:37 Hello wl888!
Heh, I glad to hear it is not only mine idea
I think internally DFPlayer CAN play tracks without pauses, because if you play tracks from folder with 0x0B command sound is good and smooth. But we have not command with which we can point DFPlayer to next track we need to play after current.
I think for a small projects we can use warkaround:
1. store playtime for every track in code
2. check playing time
3. start next track slightly before current track playtime will be reached
PS: Check you PM
doublehead
Heh, I glad to hear it is not only mine idea

I think internally DFPlayer CAN play tracks without pauses, because if you play tracks from folder with 0x0B command sound is good and smooth. But we have not command with which we can point DFPlayer to next track we need to play after current.
I think for a small projects we can use warkaround:
1. store playtime for every track in code
2. check playing time
3. start next track slightly before current track playtime will be reached
PS: Check you PM


2016-10-24 14:46:04 I am currently working on this EXACT project and have found that the DFPlayer is not suitable for what we require...smooth looping of sound....
I read in one of the other Forums that there will always be a small delay when using MP3 files, it is unavoidable.
Also the DFPlayer requires a small amount of time to process the file, normally not a problem, but no good for us.
That being said there is a way to use the DFPlayer for our purpose, it is a combination of methods:-
1/. Use the DFplayer for the feature sounds....Start , Stop, Horn,etc,etc
2/. There is a Sketch called "MojoEngineSimulator", you have provably seen it in your research and passed over it as I did, but this is the answer.
Strip this down to its minimum configuration, I presume you are using a Potentiometer DC control with Arduino, there are 3 versions in this Sketch, clean out everything but the Pot control.
This will give you a variable engine sound, proportional to throttle, with featured sounds called from the DFPlayer in ADKEY mode, with the push of a button.
I have only come up with this in the last week and am still waiting on some parts to come in to test it completely, but preliminary testing is Promising
I use the Library version2 from Github. Hex give me a headache!!!!
Hope this helps.
wl888
I read in one of the other Forums that there will always be a small delay when using MP3 files, it is unavoidable.
Also the DFPlayer requires a small amount of time to process the file, normally not a problem, but no good for us.
That being said there is a way to use the DFPlayer for our purpose, it is a combination of methods:-
1/. Use the DFplayer for the feature sounds....Start , Stop, Horn,etc,etc
2/. There is a Sketch called "MojoEngineSimulator", you have provably seen it in your research and passed over it as I did, but this is the answer.
Strip this down to its minimum configuration, I presume you are using a Potentiometer DC control with Arduino, there are 3 versions in this Sketch, clean out everything but the Pot control.
This will give you a variable engine sound, proportional to throttle, with featured sounds called from the DFPlayer in ADKEY mode, with the push of a button.
I have only come up with this in the last week and am still waiting on some parts to come in to test it completely, but preliminary testing is Promising

I use the Library version2 from Github. Hex give me a headache!!!!

Hope this helps.
