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

Gapless #85

Open
moechofe opened this issue Jul 8, 2014 · 5 comments
Open

Gapless #85

moechofe opened this issue Jul 8, 2014 · 5 comments

Comments

@moechofe
Copy link

moechofe commented Jul 8, 2014

What is the good implementation to play the next media without a gap ?

@arp242
Copy link

arp242 commented Jan 3, 2015

aurora.js starts decoding on play(); what seems required is a prepare_for_play(), which would be called a few seconds before the end of the current track. This will initialise the decoder & decode the first bytes, so that play() can now start playing almost instantaneously.

In other words, as far as I can see it's not possible at the moment ... The good news is that it's also not too difficult to add to aurora.js, but I didn't investigate too deeply (since I can't use it now anyway due to another issue).

Your only other option is to guess the delay (ie. 200ms), and start playing the second Player 200ms before the end. It should be obvious that this is flawed, since you can't reliably guess this number.

@fabslab
Copy link
Contributor

fabslab commented Jan 4, 2015

Have you tried the preload method? https://github.com/audiocogs/aurora.js/wiki/Player-Class-Reference#preload

@arp242
Copy link

arp242 commented Jan 4, 2015

Yeah, and I verified the files are being loaded in the network tab ... There is still at least a ~200-300ms delay (perhaps more)... I also tried fidgeting around with player2.asset.decoder.decode() and such, but that didn't help either...

@fabslab
Copy link
Contributor

fabslab commented Jan 4, 2015

Does calling play then immediately pause before actually wanting to play, then calling play again when ready work? I could look at the code to check if that would decode enough but don't have the opportunity right at the moment.

@arp242
Copy link

arp242 commented Jan 4, 2015

That's a good idea, and one of the things I tried yesterday :-) with no notable difference unfortunately...

I didn't investigate the code too much, and the above is what looks like the problem based on glancing the code; but I'm not absolutely sure ...

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

3 participants