Re: Missing audio when converting PCM to Ogg
Ilya Ganelin <[email protected]> Thu, 24 Oct 2013 10:21:12 -0400
| Newsgroups | gmane.comp.multimedia.ogg.vorbis.devel |
|---|---|
| Message-ID | <CAM-S9zTt9oawRamnWsKHgkUNKO2-s9hrLdYcyAZyREnaqGzdEA@mail.gmail.com> |
Thanks R.L. ! That was exactly what I needed . -Ilya Ganelin On Wed, Oct 23, 2013 at 11:04 PM, R.L. Horn <[email protected]> wrote: > On Tue, 22 Oct 2013, Ilya Ganelin wrote: > > > I still have a small issue in that a small amount of the audio is > > clipped at the start of the stream. > > Be sure that you flush the stream after passing the headers and before > the coding loop: > > vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code); > ogg_stream_packetin(&os,&header); /* automatically placed in its own > page */ > ogg_stream_packetin(&os,&header_comm); > ogg_stream_packetin(&os,&header_code); > > /* This ensures the actual > * audio data will start on a new page, as per spec > */ > for(;;) { > int result=ogg_stream_flush(&os,&og); > if(result==0)break; > fwrite(og.header,1,og.header_len,stdout); > fwrite(og.body,1,og.body_len,stdout); > } > > Note that encoder_example.c actually uses "while(!eos)" here, but that > only works because eos was initialized to zero (i.e. !eos always evaluates > as true). > _______________________________________________ > Vorbis-dev mailing list > [email protected] > http://lists.xiph.org/mailman/listinfo/vorbis-dev > _______________________________________________ Vorbis-dev mailing list [email protected] http://lists.xiph.org/mailman/listinfo/vorbis-dev