[Speex-dev] Samples per frame.. fixed or variable with configuration?

Thorvald Natvig speex at natvig.com
Mon Sep 19 15:52:56 PDT 2005

> I'm having trouble with a Speex VOIP effort ... my first use of Speex.
> My development platform is Windows XP, but I intend to bring this up on OS X 
> as well.
> At the moment, I send across speex frames (say 4 per packet... a configurable 
> setting), and the settings of both encoder and decoder are simply fixed in 
> code at the moment (wideband, short format input).
> I am fairly confident that I am roughly using it as intended, but I get 
> nothing but noise out.
> I have verified that the input audio is righteous, as I save it to a file for 
> diagnostic purposes.
> I have some questions:
> 1.  Is it sufficient to obtain the frame size (in samples per frame) after 
> setting the mode of encoder and decoder?  Or might this figure change if (for 
> intance), one set the quality of the encoder or enabled perceptual 
> enhancement on the decoder?

No, the frame size is 20ms. Always.

> 2.  Is there any external requirement to cater to endian-ness of the data 
> passed to speex_encode() or speex_encode_int(), or does speex just like the 
> native representation?  How about for the float data output from 
> speex_decode()?  I have not run any configuration script.

For speex_encode_int() and speex_decode_int(), the format is signed 16-bit 
short, meaning integers in the range -32768 to +32767. If you're sampling 
with normal 16-bit data that should be perfectly usable.

You say you're developing on windows; did you compile the library 
yourself? If so, you should verify with speexenc and speexdec that it 
works. At least for the previous release of speex, the compiler 
did funny things if you enabled autovectorization and other advanced 

More information about the Speex-dev mailing list