[Speex-dev] "More than two wideband layers found. The stream is corrupted." problem

Marian Kechlibar marian.kechlibar at circletech.net
Fri Feb 13 01:19:21 PST 2009

Dear Speex developers,

I am currently experimenting with Speex on Symbian smartphones.

I have compiled the Speex library, and I am now using it in the
following way:

1. Record 320-byte buffers of data in PCM16 format, 8000 Hz sampling rate.
2. Feed the resulting buffer to an instance of a narrowband Speex encoder.
3. Send the encoded data over RTP.
4. Upon receiving on the other side, feed the payload to a narrowband
Speex decoderd.
5. Play the resulting PCM to the reproductor.

However, currently I am stuck in point 4. All of a sudden, the STDOUT
window appears and a huge list of the error messages
"More than two wideband layers found. The stream is corrupted."
flood the screen of the phone (btw: pretty scary sight :-)

I found the message in the file nb_celp.c, in this section of code:

               wideband = speex_bits_unpack_unsigned(bits, 1);
               if (wideband)
                  speex_notify("More than two wideband layers found. The
stream is corrupted.");
                  return -2;

Does this error look familiar to any of you?

How did I manage to corrupt the Speex state? I am using RTP over UDP,
and that UDP runs over GPRS/EDGE, so the sequence of the packets is
not necessarily kept - is this the problem? Should I use the built-in
jitter buffer, or write some kind of my own? Some packets get lost
on the way, since GPRS is not a particularly reliable connection.
Can this damage the Speex internal state too?

Best regards

Marian Kechlibar

More information about the Speex-dev mailing list