[vorbis-dev] Calculating vorbis packet durations...

Segher Boessenkool segher at kernel.crashing.org
Wed May 19 01:53:44 PDT 2004



>> while( !endOfPackets)
>>     {
>>     getPacket;
>>     check if this is and audio packet;
>>     read window configurations;
>
> What is this window configurations... i'm not very familiar with the 
> vorbis
> packet structure, as i use a wrapper to libvorbis. Could you perhaps 
> tell me
> what the field names (or their byte positions ) in the packet are for 
> this ?

It's the first few bits (window size selection).

>>     thisPacketSize = previousPacketWindowSize/4+ 
>> thisPacketWindowSize/4;
>
> So this means that you still can't get an accurate result without the
> previous page ?

No, the size of the previous window is encoded in the current packet.

But you (in general) can't generate any valid output audio samples
without the previous packet(s) [*], though.

<p>Segher

<p>[*] One packet is always enough for current Vorbis; but that number
might change (although that would be a pretty big change...)
Also sometimes you *can* decode *some* samples without using the
previous packet, namely, when the current packet is switching window
size.  But you don't want to, so forget that :-)

--- >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