Player isActive behaviour #1552
-
I'm developing software based on an a player using audio tools for WAV files using SDMMC and I2S. I need to know when the active file has finished playing. The player is configured to not do auto next. I found that player.isActive() returned true even when the track had finished. A bit of checking in AudioPlayer.h moveToNextFileOnTimeout() function shows that the procedure returns without clearing active if not using auto next. Further down in the function it there is a section of code that can't be reached, because of the early return, would clear active flag. Commenting out the first two lines of the function ensures that things work as expected. Have I discovered a bug? Apologies if this is not the correct way to report this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Just check how many bytes the copy() command was processing. If it is 0 you are at the end! |
Beta Was this translation helpful? Give feedback.
Just check how many bytes the copy() command was processing. If it is 0 you are at the end!
By the way this is also explained in the Copy section of the The most important basics!. I suggest that you spend some time reading the Wiki