Re: Cortado gapless looping
"Benjamin M. Schwartz" <[email protected]> Sat, 06 Feb 2010 12:43:49 -0500
| Newsgroups | gmane.comp.multimedia.ogg.theora.devel |
|---|---|
| Message-ID | <[email protected]> |
Gregor Richards wrote: > I've been looking in to adding it myself, but I'm not used to Java > enough to digest a project that complex. So I'm hoping that somebody > with more indepth knowledge of Cortado could give me some tips on where > I need to add it. I figure there are a few possible places ... there > could be a class that abstracts an ogg file and presents it as a stream > of the same ogg file over and over again, or at a higher level whatever > is buffering the audio could understand how to reread any file type ... > but I'm not sure where or how to implement either of these :) The principal difficulty I see with looping is avoiding downloading the file over and over again. In Cortado, I believe that every "seek" event (e.g. restarting the stream) causes all current buffers to be dropped. This makes sense because Cortado is designed to handle large files, and cannot touch the disk. Cortado only buffers ahead of the current playback point, for streaming. I imagine that you don't want users to be downloading your loop over and over again; otherwise you could just stream it continuously from the server. One relatively easy hack would be to forgo all the http streaming, and instead ship the vorbis file inside the .jar. This would simplify your life considerably, but would force users to download the entire loop before initiating playback. It's also less reusable than one might like. The ideal solution would involve augmenting the buffering logic to allow caching of entire files, up to some size limit, so that one may loop back to the beginning. My best idea on how to accomplish this is to (optionally) cache the file inside HTTPSrc. Even after that, some trickery would be needed for gapless playback. OggDemux would probably require a "loop" flag, which would cause it to seek to the beginning if it receives an End Of Stream (EOS) message, instead of passing forward the EOS. By the way, Cortado's internal design is very close to Gstreamer 0.10. Reading the gstreamer docs may help to understand what's going on. Feel free to keep asking questions here, of course. --Ben _______________________________________________ theora-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/theora-dev
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkttqlUACgkQUJT6e6HFtqS//wCfeaE7OPqvDIIajXWHAF0V8VCr +AcAn0kpsc3NCMpoUK4rP4gStKtKQmFG =D91e -----END PGP SIGNATURE-----