[vorbis-dev] Can I join many ogg_packet together and decode it to PCM?

Michael Smith msmith at xiph.org
Tue Apr 13 18:37:14 PDT 2004



On Wednesday 14 April 2004 08:01, Kenji Chan wrote:
> Can I join many ogg_packet together and decode it to PCM?
>
> Or I have to encode each ogg_packet at a time?
>
>
>
> If each packet is 1024 long, can I join 1.5 of packet (1024+512), and
> decode that 1024+512 packet, and then decode the 512 left?
>
> Or I must decode a whole packet, and can't cut it or decode only some of it
> (not all)
>

You always have to decode an entire packet at one time, because of the nature 
of the transforms used by vorbis (this is something vorbis has in common with 
all the other interesting audio codecs).

However, ogg vorbis has a feature that allows the ogg layer (or some other 
layer, if you want) to tell the decoder that a packet should be truncated at 
the start or end of the stream. This allows ogg vorbis files to be (when 
decoded) the same length as the original input file. The format documentation 
explains in detail how this works (from the application development 
perspective, it 'just works').

Mike

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