[Vorbis-dev] Missing audio when converting PCM to Ogg
Ilya Ganelin
ilganeli at gmail.com
Thu Oct 24 07:21:12 PDT 2013
Thanks R.L. ! That was exactly what I needed .
-Ilya Ganelin
On Wed, Oct 23, 2013 at 11:04 PM, R.L. Horn <lists at eastcheap.org> 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
> Vorbis-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/vorbis-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20131024/c0100439/attachment.htm
More information about the Vorbis-dev
mailing list