[Speex-dev] 21bytes vs 38 bytes

Jim Crichton jim.crichton at comcast.net
Wed Jun 13 10:44:03 PDT 2007


The Speex sample rate is 8000 Hz for narrowband operation.  The Speex bitrate depends upon the setting of the Quality parameter.  Here is a table for narrowband from the draft RTP definition:

+------+---------------+-------------+
| mode | Speex quality |   bitrate   |
+------+---------------+-------------+
|   1  |       0       | 2.15 kbit/s |
|      |               |             |
|   2  |       2       | 5.95 kbit/s |
|      |               |             |
|   3  |     3 or 4    | 8.00 kbit/s |
|      |               |             |
|   4  |     5 or 6    | 11.0 kbit/s |
|      |               |             |
|   5  |     7 or 8    | 15.0 kbit/s |
|      |               |             |
|   6  |       9       | 18.2 kbit/s |
|      |               |             |
|   7  |       10      | 24.6 kbit/s |
|      |               |             |
|   8  |       1       | 3.95 kbit/s |
+------+---------------+-------------+

So, you want the quality to be 3, and it is set (default?) to 7 or 8.  If you are talking about raw Speex frames, the size should be 20 bytes, not 21.

This information is in Tables 8.1 and 8.2 the Speex manual (http://www.speex.org/docs/).  You really should read it.

- Jim


  ----- Original Message ----- 
  From: Yusuf Bey 
  To: Jean-Marc Valin ; speex-dev at xiph.org 
  Sent: Wednesday, June 13, 2007 12:59 PM
  Subject: Re: [Speex-dev] 21bytes vs 38 bytes


  Hello, thank you for responding. I'm sure I'm confusing something, but I did not explicitly set either kHz or kbps, I just set the mode to narrowband, and traced through libspeex's code to see that sample_rate was 8000 something, I'm guessing Hz. My assumption was: if you set PA to nb-mode, then you should encode 160 bytes to 21. Is that mistaken? 


  ys



  On 6/13/07, Jean-Marc Valin <jean-marc.valin at usherbrooke.ca> wrote: 
    You you confusing kHz and kbps by any chance?

            Jean-Marc

    Yusuf Bey a écrit : 
    > Hi, I am developing a voip phone that uses speex v1.2b1 narrowband mode.
    > Libspeex decodes the 21-byte packets I recieve into 160 bytes and I can
    > play
    > them fine, but when I encode, the result is 38-bytes long. 
    >
    > I have read that 38 bytes means that it is encoding at 15KHz, but I have
    > set
    > it to nb-mode and when stepping through the libspeex encoding sourcecode, I
    > see that st->sampling_rate is 8000. 
    >
    > Any idea why I speex-compress 160 bytes to 38 and not 21? Thanks in
    > advance.





------------------------------------------------------------------------------


  _______________________________________________
  Speex-dev mailing list
  Speex-dev at xiph.org
  http://lists.xiph.org/mailman/listinfo/speex-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20070613/84ae4297/attachment.htm


More information about the Speex-dev mailing list