Skip to main content

Topic: How to get all packets of ogg file (Read 11192 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • troyou
  • [*]
How to get all packets of ogg file
I want to get all the vorbis packets of ogg file and put it into a list and I don't want to decode it right now.

now I have do this:

Code: [Select]
ogg_sync_state oy;
ogg_stream_state os;
ogg_page og;
ogg_packet op;
vorbis_info vi;
vorbis_comment vc;
vorbis_dsp_state vd;
vorbis_block vb;

vorbis_synthesis_init(&vd,&vi);
vorbis_block_init(&vd,&vb);
ogg_sync_pageout(&oy,&og);
ogg_stream_pagein(&os,&og);
ogg_stream_packetout(&os,&op);

//decode packet right now.   if I don't decode it right now then will skip this step

/*
vorbis_synthesis(&vb,&op)
vorbis_synthesis_pcmout(&vd,&pcm)
vorbis_synthesis_read
*/

//continue to get packet


if I decode packet right now then I can continue to get packets. But if I don't decode it and I just want to put they into List then I cannot to get the packets. How should I do?

  • sheh
  • [*][*]
How to get all packets of ogg file
Reply #1
I've never used libogg, but maybe ogg_sync_pageseek()?