-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilePlayer: Add playback position to .startPlayingFile function #66
base: master
Are you sure you want to change the base?
Conversation
Allow to jump to specified position for audio playback. Following the instructions in the Adafruit forum: https://forums.adafruit.com/viewtopic.php?f=25&t=123646
Does this work for all file formats? Any file headers will be skipped as well. |
Because only the mp3 file header is skipped and not the ones of other formats? I did not change it vs the current Adafruit version, which means that skipping any headers other than mp3 has not been implemented to the master version so far. |
I meant it the other way around: Some file format NEED the file headers to be sent to the decoder |
Ah now I get it! Uff, I don't think that I have the skills to implement the position for other file types, so I rather close the pull request. Thank you for the input! |
Nono, please don‘t give up because of me. Maybe it makes sense to make the jump for MP3s only. If other file types are needed, this could still be extended. |
Thanks mate. Sorry, it is my first pull request and I'm not a programmer, so I was not sure. |
I would love to see this feature get implemented. Could we consider merging this PR? |
This is more than three years old, do we close it or does someone want to pick it up and make it mergeable? |
So this work is good for mp3 files right? |
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.