[speex-dev] auto-detection of frame boundary

Jean-Marc Valin jean-marc.valin at hermes.usherb.ca
Mon May 12 11:52:13 PDT 2003


Le lun 12/05/2003 à 14:27, Tongbiao Li a écrit :
> I tried feeding in the 3 encoded frame in ONE BLOCK, and calling speex_decode() 3 times in a roll. Only the 1st frames came out perfectly.  For the other 2, I got "corrupt" frame warning.  
> 
> I was supposed to get 38 bytes consumed each frame (narrow-band, VBR off). I tried speex_bits_remaining() to peek on the # of bits consumed, and got variable (clearly wrong)#s returned. 
> 
> But if I used length-prefix, and having it read in each frame separately before calling speex_decode() on each, the frames came out OK.  So the frames were encoded OK, and only the way I called on the decoding side had problems.
> 
> The question is: do I need to let the decoder read in each frame separately and speex_decode() on each?    Note, for VBR, I have to transfer frame size for EACH frame, which is not as desirable.

It probably means that something's wrong with your code. It should look
like:

SpeexBits bits;
...
speex_encode(enc, frame1, &bits);
speex_encode(enc, frame2, &bits);
speex_encode(enc, frame3, &bits);

//decode

peex_decode(dec, &bits, frame1);
speex_decode(dec, &bits, frame2);
speex_decode(dec, &bits, frame3);

See speexenc.c and speexdec.c for more details (--nframes option).

        Jean-Marc


-- 
Jean-Marc Valin, M.Sc.A.
LABORIUS (http://www.gel.usherb.ca/laborius)
Université de Sherbrooke, Québec, Canada

<p>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Ceci est une partie de message numériquement signée
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20030512/a0de500f/signature-0001.pgp


More information about the Speex-dev mailing list