[Speex-dev] Mode 13 packet length

Jack Schmidt speex at mowsey.org
Wed Apr 1 16:26:12 PDT 2009


Howdy, I am confused about the length of a mode 13 packet.


I try to add an empty packet with:

    speex_bits_pack(&enc_bits, 13, 5 ); // mode 13
    speex_bits_pack(&enc_bits,  0, 5 ); // length is 0 bytes

However this gives lots of errors in the reference implementation of  
speex_decode_int().


Instead if I do:

    speex_bits_pack(&enc_bits, 13, 5 ); // mode 13
    speex_bits_pack(&enc_bits,  0, 4 ); // length as read by  
speex_default_user_handler
    speex_bits_pack(&enc_bits,  0, 5 ); // 5 extra unused bits

everything is fine.


I think this may be a bug in speex_default_user_handler, as it appears  
to contradict the documentation at:
   http://speex.org/docs/manual/speex-manual/node7.html#SECTION007100000000000000000

and the packet parser "speex_get_samples" at:
   http://iaxclient.svn.sourceforge.net/viewvc/iaxclient/trunk/lib/libiax2/src/iax.c?view=markup


I'd like to use mode 13 packets, but I am worried about the differing  
implementations.


More information about the Speex-dev mailing list