I've got a question about the granulepos in speex packets.>From the speex manual (http://www.speex.org/manual2/node7.html#SECTION00073000000000000000):>The third and subsequent packets each contain one or more (number found in header) Speex frames. These are identified with packetno starting from 2 and the granulepos is the number of the last sample encoded in that packet.In experimenting however, it seems that the granulepos is only valid in the last packet in each ogg page -- all other packets have it set to -1. Are the docs incorrect, or am I doing something wrong? If the granulepos isn't available on a per-packet basis, is there a recommended way of quickly seeking to a particular sample frame? Thanks in advance for any pointers. Regards, Owen
Hi Owen, The granulepos is only available on a per-page basis (otherwise it would take up too much space). You can probably see how to use it by looking at speexdec.c Jean-Marc On jeu, 2004-09-16 at 23:19 -0700, Owen wrote:> I've got a question about the granulepos in speex packets. > > >From the speex manual (http://www.speex.org/manual2/node7.html#SECTION00073000000000000000): > > >The third and subsequent packets each contain one or more (number found in header) Speex frames. These are identified with packetno starting from 2 and the granulepos is the number of the last sample encoded in that packet. > > In experimenting however, it seems that the granulepos is only valid in the last packet in each ogg page -- all other packets have it set to -1. > > Are the docs incorrect, or am I doing something wrong? If the granulepos isn't available on a per-packet basis, is there a recommended way of quickly seeking to a particular sample frame? > > Thanks in advance for any pointers. > > Regards, > Owen > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev
On 17-sep-04, at 8:30, Jean-Marc Valin wrote:> The granulepos is only available on a per-page basis (otherwise it > would > take up too much space). You can probably see how to use it by looking > at speexdec.cThe libogg library _should_ however compute this per *packet*. I know it doesn't. I know it'll be hard for it to do, esp. as how to compute it is codec-dependent. But it still should ;-) Segher