[Vorbis-dev] How To Encode Realtime

yut_1985 at foxmail.com yut_1985 at foxmail.com
Mon Sep 17 20:55:32 PDT 2007


Hi,

  Forgive my poor English, I'm trying to implement a net phone using vorbis codec, which need realtime encode and decode the stream.

	The problem is, I use vorbis_analysis_buffer() and vorbis_analysis_wrote() push the PCM data in, then use vorbis_analysis_blockout(&vd, &vb) to output a block, it can't output all the data. It seems that some data which length is constant, must be in the vorbis_dsp_state, can not be output. When Decode, there's similar problem. These lead time lapse.

	I have tested, 22050, 1 channel. 
	First, vorbis_analysis_wrote(&vd, 2048), vorbis_analysis_blockout(&vd, &vb), no block out.
	After, every time vorbis_analysis_wrote(&vd, 1024), vorbis_analysis_blockout(&vd, &vb), one or two block out, but I guess it's content is which I have pushed in previously. 

	Is there a solution to encode and decode realtime, no leavings? Like vorbis_bitrate_flushpacket(), flush a block?

Regards
              


More information about the Vorbis-dev mailing list