<div dir="ltr">Thanks R.L. ! That was exactly what I needed .</div><div class="gmail_extra"><br clear="all"><div>-Ilya Ganelin</div>
<br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 11:04 PM, R.L. Horn <span dir="ltr"><<a href="mailto:lists@eastcheap.org" target="_blank">lists@eastcheap.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, 22 Oct 2013, Ilya Ganelin wrote:<br>
<br>
> I still have a small issue in that a small amount of the audio is<br>
> clipped at the start of the stream.<br>
<br>
</div>Be sure that you flush the stream after passing the headers and before<br>
the coding loop:<br>
<br>
vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code);<br>
ogg_stream_packetin(&os,&header); /* automatically placed in its own<br>
page */<br>
ogg_stream_packetin(&os,&header_comm);<br>
ogg_stream_packetin(&os,&header_code);<br>
<br>
/* This ensures the actual<br>
* audio data will start on a new page, as per spec<br>
*/<br>
for(;;) {<br>
int result=ogg_stream_flush(&os,&og);<br>
if(result==0)break;<br>
fwrite(og.header,1,og.header_len,stdout);<br>
fwrite(og.body,1,og.body_len,stdout);<br>
}<br>
<br>
Note that encoder_example.c actually uses "while(!eos)" here, but that<br>
only works because eos was initialized to zero (i.e. !eos always evaluates<br>
as true).<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Vorbis-dev mailing list<br>
<a href="mailto:Vorbis-dev@xiph.org">Vorbis-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/vorbis-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/vorbis-dev</a><br>
</div></div></blockquote></div><br></div>