Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

MrTolchock
Copy link

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.

@TheNitek
Copy link
Contributor

TheNitek commented Jan 6, 2020

Does this work for all file formats? Any file headers will be skipped as well.

@MrTolchock
Copy link
Author

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.

@TheNitek
Copy link
Contributor

TheNitek commented Jan 7, 2020

I meant it the other way around: Some file format NEED the file headers to be sent to the decoder

@MrTolchock
Copy link
Author

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!

@MrTolchock MrTolchock closed this Jan 7, 2020
@TheNitek
Copy link
Contributor

TheNitek commented Jan 7, 2020

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.

@MrTolchock
Copy link
Author

Thanks mate. Sorry, it is my first pull request and I'm not a programmer, so I was not sure.

@MrTolchock MrTolchock reopened this Jan 7, 2020
@jonfroehlich
Copy link

I would love to see this feature get implemented. Could we consider merging this PR?

@johnwargo
Copy link
Contributor

This is more than three years old, do we close it or does someone want to pick it up and make it mergeable?

@julianCast
Copy link

So this work is good for mp3 files right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants