[vorbis-dev] Importing Ogg Vorbis

Michael Smith msmith at labyrinth.net.au
Sat May 19 00:23:48 PDT 2001



>> 1.  Neither Ogg nor Vorbis has information at the front of the stream
>>     telling how long it is.  You need to look at the granulepos on the
>>     last page in the Ogg framing to learn that.  The granulepos is the
>>     absolute frame number in the raw stream of the last frame encoded in
>>     that packet/page.
>
>You need to get the granulepos of the first and last samples in the file;
>Ogg Vorbis allows sample-precise stream cutting/editing.

This is wrong, Steve was correct to start with. The granulepos of the final
page in each (logical) stream is all you require. granulepos always starts
at zero. The only case where this won't give you the length is when you're 
starting from somewhere other than the beginning (like in streaming), and 
then you can't calculate the length at all.

Michael

--- >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-dev-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-dev mailing list