[Speex-dev] Win CE playback error

ohjames ohjames at singnet.com.sg
Tue Feb 22 17:37:23 PST 2005


I have a module sampling raw PCM data on Win CE as 10ms time slice (160 bytes), mono, 8000HZ, 16 bits per sample.

Does anyone know what is the mflops for using fixed point on a Win CE compared to using floating point?

Looking at the manual,

"In practice, frame_size will correspond to 20 ms when using 8, 16, or 32 kHz sampling

for a 8 kHz sampling, the framesize should be 320 right?

But when i use 


The framesize i got is 160.

I am trying to encode the data which is contained as an unsigned char buffer[160] as mode 2 of 5,950 bps and stored as the same data type as unsigned char array after encoding

I have managed to link the libspeex_armce.lib file successfully but have gotten garbage on playback.

I am not sure if i have done it correctly.
Below are snippets of the coding.

Any help is appreciated.

//assuming data is stored as unsigned char buffer[160];
//Trying to use Fixed Point

SpeexBits bits;

void *enc_state;
enc_state = speex_encoder_init(&speex_nb_mode);
void *dec_state;
dec_state = speex_decoder_init(&speex_nb_mode);

int i;
int x;
x = 5950; //set the bit-rate
x = 8000;  //set the sampling rate

x = 2;   //set the quality

x = 3;   //set the complexity
//to convert my unsigned char buffer array to short for encoding

short TempEncode [160];
for (i=0; i<160; i++);
 TempEncode[i] = buffer[i];

speex_encode_int(enc_state, TempEncode, &bits);

char encode[200];
int nbBytes = speex_bits_write(&bits, encode, 200);



speex_bits_read_from(&bits, encode, nbBytes);
short TempDecode[160];
speex_decode_int(dec_state, &bits, TempDecode);

//Declare an unsigned char buffer2
// Convert from short back to unsigned char for playback
unsigned char buffer2[160];
for (i=0; i<160; i++);
buffer2[i] = TempDecode[i];


More information about the Speex-dev mailing list