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

Ralph Giles giles at xiph.org
Thu Dec 13 18:33:50 PST 2007

On Thu, Dec 13, 2007 at 04:17:32PM -1000, Jim Buschman wrote:

> no, i don't seem to ever get an eos page

Ok, so assuming you set eos properly when you submit the last buffer for 
compression, you're not writing out the last bit of the stream.

You need to loop on ogg_stream_pageout while it returns a positive 
number and eos is not set, inside the while loop for getting new vorbis 
packets. Then, if you're out of data and still haven't seen eos you need 
to while on ogg_stream_flush() to get the last bits out. Or you could 
not  bother checking; ogg_stream_flush() will just return 0 if there's 
no data left.


More information about the Vorbis-dev mailing list