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

Unable to seek #187

Open
llynix opened this issue Mar 28, 2023 · 1 comment
Open

Unable to seek #187

llynix opened this issue Mar 28, 2023 · 1 comment

Comments

@llynix
Copy link

llynix commented Mar 28, 2023

I found myself unable to seek forward into a track because I was unable to figure out what time I was currently playing.

I made the fPosition function public. And came up with this seek code to seek x second forward into the song.

void aseek(int stime) {
if(audio.isPlaying()) {
unsigned long cur = audio.fPosition();
unsigned long cursec = cur / sample_rate;
audio.stopPlayback();
char file_name[20] = "";
itoa(play_number,file_name,10);
strcat(file_name,".wav");
int ftime = cursec + stime;
#ifdef AR_DEBUG
Serial.println(ftime);
#endif
audio.play(file_name, ftime);
}
}

Just wanted to let you know my solution. Not really an issue.

@TMRh20
Copy link
Owner

TMRh20 commented May 5, 2023

Thanks for the contribution, I will mark this as an enhancement, and if I ever get a chance, will think about incorporating it into the library.

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

No branches or pull requests

2 participants