Hi, I was wonder how Speex handles (if at all ) lost packets when decoding the bit-stream . 1. Does Speex has any mechanism to handle lost packets (like AMR has for example)? 2. I am using Speex in a constant frame size (160 bytes), narrowband, VBR off, SPEEX_SET_QUALITY = 3 and SPEEX_SET_COMPLEXITY =1 . I encode speech stream and sending the encoded packets to the their destination. If I am loosing 4 continuous frames during the transmission , what can I expect to hear? noise ? quiet ? echo ? Can anyone help me with this issues ? Regards, Uri Rattner -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20081126/2bcaa230/attachment.htm
Just pass NULL as the "bits" argument to the decoder and Speex will generate a frame to play instead of your lost packet. You can also use speexdec --packet-loss X (where X is the loss in percent) to simulate packet loss. Jean-Marc Uri Rattner a ?crit :> Hi, > > > > I was wonder how Speex handles (if at all ) lost packets when decoding > the bit-stream . > > > > 1. Does Speex has any mechanism to handle lost packets (like AMR > has for example)? > > 2. I am using Speex in a constant frame size (160 bytes), > narrowband, VBR off, SPEEX_SET_QUALITY = 3 and SPEEX_SET_COMPLEXITY > =1 . > > I encode speech stream and sending the encoded packets to the their > destination. > > If I am loosing 4 continuous frames during the transmission , what can > I expect to hear? noise ? quiet ? echo ? > > > > > > Can anyone help me with this issues ? > > > > Regards, > > Uri Rattner > > > ------------------------------------------------------------------------ > > _______________________________________________ > Speex-dev mailing list > Speex-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev
On Wednesday 26 November 2008 10:02:49 Uri Rattner wrote:> 1. Does Speex has any mechanism to handle lost packets (like AMR > has for example)?Quoting the docs: Again, once the decoder initialization is done, for every input frame: speex_bits_read_from(&bits, input_bytes, nbBytes); speex_decode_int(dec_state, &bits, output_frame); where input_bytes is a (char *) containing the bit-stream data received for a frame, nbBytes is the size (in bytes) of that bit-stream, and output_frame is a (short *) and points to the area where the decoded speech frame will be written. A NULL value as the second argument indicates that we don't have the bits for the current frame. When a frame is lost, the Speex decoder will do its best to "guess" the correct signal.> 2. I am using Speex in a constant frame size (160 bytes), > narrowband, VBR off, SPEEX_SET_QUALITY = 3 and SPEEX_SET_COMPLEXITY > =1 . > > I encode speech stream and sending the encoded packets to the their > destination. > > If I am loosing 4 continuous frames during the transmission , what can > I expect to hear? noise ? quiet ? echo ?interpolation, i.e. the decoder trying hard to fill the gap with "similar" sound to what was occurring previously. Peter