Adafruit_VS1053_Library
Adafruit_VS1053_Library copied to clipboard
FilePlayer: Add playback position to .startPlayingFile function
The original .startPlayingFile function of the Adafruit_VS1053_FilePlayer class always starts playback from position 0. This pull request proposes very few changes to allow for an optional position input for the .startPlayingFile function in order to start playback also from a defined position which is not 0. In addition, the new getFilePosition function allows to check for the current playback position of a file.
These changes were proposed by adafruit_support_rick in this post: https://forums.adafruit.com/viewtopic.php?f=25&t=123646. I only changed the seek part a bit, such that the approach also works for mp3 files.
The changes were successfully tested with the Arduino 1.8.11 IDE, an Adafruit Feather ESP8266 and the Music Maker FeatherWing w/ Amp.