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

'track-end' event sent early #47

Open
ghost opened this issue Aug 1, 2015 · 5 comments
Open

'track-end' event sent early #47

ghost opened this issue Aug 1, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 1, 2015

Hi @Floby - awesome work on this project, it's perfect for what I'm doing. I know you haven't touched this in a long while, but I was wondering if you had any thoughts on what might cause the track-end event to be sent early, before the track has played all the way through. From how I understand it, this comes directly from sp_session_callbacks::end_of_track in libspotify. I suppose there could be a bug in libspotify, but it happens probably around a third of the time in my experience.

@IainCole
Copy link
Contributor

IainCole commented Aug 1, 2015

This can happen if you are consuming the audio data from the stream faster than you should be.. Do you have any example code where this is happening?

@ghost
Copy link
Author

ghost commented Aug 1, 2015

@IainCole Here's a gist of what I'm doing. I'm piping this out to a response. https://gist.github.com/sciencepro/4481545fe5099b363ef3

@IainCole
Copy link
Contributor

IainCole commented Aug 1, 2015

So you are returning audio data to some web app then playing it? I think what's happening is the audio data is being returned to the app effectively as fast as it can encode/download, so you're getting the track-end message when it's finished being downloaded rather than being played.

@ghost
Copy link
Author

ghost commented Aug 1, 2015

Ah, that makes sense. That's what I'm trying to do. Any suggestions on how I can control this better? Thanks for your help.

@IainCole
Copy link
Contributor

IainCole commented Aug 1, 2015

Depends how you're playing it and what you're using the track-end message for. I think it would have to be handled in the app, perhaps by buffering the audio data and checking when it's empty or something.

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

No branches or pull requests

1 participant