[vorbis] Servlet streamed Ogg skips

Tor-Einar Jarnbjo Tor-Einar at jarnbjo.de
Sat May 1 03:34:42 PDT 2004



> Ahh, so you think that WinAmp is driven by the data arrival rate when
> reading from an http link, rather than the inherent OGG data rate like it
> does when reading the same data from a disk file?  I had not considered
> that.  If I make the servlet send a filesystem path to the .ogg file (when
> the server and WinAmp are on the same system) then WinAmp plays back
> properly.  So the ogg stream must contain internal information about the
> correct playback speed.  Makes sense.

I did a few tests and this seems indeed to be the case, but I also found a
probably simpler solution for you than throttling the bitrate in your
servlet. I tested a bit with Winamp 5 and it seems to be interpreting the
presence or absence of a content length header in the HTTP response to
determine its behaviour:

Content length header is not present -> Winamp assumes that you're reading a
live (contiguous) stream, like an online radio or whatever and tries to sync
to the HTTP stream all the time. This would cause the behaviour you've
experienced.

Content length header is present -> Winamp assumes static media and
synchronizes the download rate to the actual bitrate of the Ogg stream.

See if you can solve your problem by setting the content length with
HttpServletResponse.setContentLength(int) or you could also take a look at
J-Ogg (www.j-ogg.de) if you're interested in parsing the Ogg stream in your
servlet to be able to stream at a correct rate. A high level decoding would
be enough for you, as the Ogg pages have a timestamp in their
absoluteGranulePosition field.

<p>Tor

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list