Joshua Haberman
2003-Nov-25 21:21 UTC
[vorbis-dev] trouble getting libvorbis to cut beginning of the bitstream
I'm having trouble getting libvorbis to cut the beginning of a bitstream when I instruct it to do so with granulepos. I have constructed a file which I believe should have its beginning truncated. I have attached it to this mail. Here is a picture of what the bitstream looks like, as output by a python program that uses pyogg/pyvorbis to read the stream and print a representation: <OggPage, BOS pageno = 0, granulepos = 0, serialno = 2079510926, head length = 28, body length = 30 at 0x4019b3e0> <OggPacket, BOS packetno = 0, granulepos = 0, length = 30 at 0x401e7bb0> <OggPage, pageno = 1, granulepos = 0, serialno = 2079510926, head length = 44, body length = 3877 at 0x4019b368> <OggPacket, packetno = 1, granulepos = -1, length = 45 at 0x401e7bb0> <OggPacket, packetno = 2, granulepos = 0, length = 3832 at 0x401e7bd8> <OggPage, EOS pageno = 2, granulepos = 934, serialno = 2079510926, head length = 30, body length = 506 at 0x4019b3f8> <OggPacket, packetno = 3, granulepos = -1, length = 248 at 0x401e7bd8> <OggPacket, EOS packetno = 4, granulepos = 934, length = 258 at 0x401e7bb0> Notice that the granulepos of the last ogg page is 934. There are 1048 samples in that page (the overlap/add of those two packets), and my understanding is that libvorbis should only return the first 934 of them. However, when I decode to wav with ogg123, the resulting file is 1024 samples long, as verified with sndfile-info (from libsndfile). Any ideas? What am I doing wrong? Josh -------------- next part -------------- A non-text attachment was scrubbed... Name: TruncateBeginning.ogg Type: application/x-ogg Size: 4704 bytes Desc: TruncateBeginning.ogg Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20031125/72396921/TruncateBeginning-0001.bin