[Vorbis-dev] Help recording from PCM stream and silence.

Jim Buschman jim.buschman at gmail.com
Thu Dec 13 17:58:56 PST 2007


Ok, so when I'm writing my pages I'm doing this…

while(vorbis_bitrate_flushpacket(vorbisDsp,oggPacket))
{
ogg_stream_packetin(oggStream,oggPacket);

int result=ogg_stream_pageout(oggStream,oggPage);
if(result==0)
break;

fwrite(oggPage->header,1,oggPage->header_len,newFile);
fwrite(oggPage->body,1,oggPage->body_len,newFile);

if(ogg_page_eos(oggPage))
eos=1;
}

And if i'm reading what you said correctly, when i do the " if (result==0) "
check i should call ogg_stream_flush before i break?

On Dec 13, 2007 3:34 PM, Ralph Giles <giles at xiph.org> wrote:
> Without seeing code, I'd suggest making sure you're flushing *all* the
> pages out of the ogg_stream and writing them out. Silence compresses
> well, so if you don't call 'ogg_stream_flush' you may not see a page for
> some time.
>
> Note that for streamability you should always call ogg_stream_flush
> if ogg_stream_pageout hasn't returned a page in more than a couple
> seconds of input data. libogg isn't smart enough to handle this for you,
> and it can cause underruns when streaming.
>
>  -r
>



-- 
~Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20071213/82718581/attachment.htm


More information about the Vorbis-dev mailing list