[Speex-dev] Conversion problem in encoding and decoding

Tay YueWeng yueweng at yahoo.com
Tue Jan 4 04:54:22 PST 2005

--- Vinod Vijayan <vinod at speechdesk.com> wrote:

> Hi,
>   I am new to this newsgroup. I have a problem using
> the Speex library.
>   I have recorded sound data using a character
> buffer like
>   char recMessg[BUFFERSIZE]. I have problem
> converting this to the
>   float array for encoding. 

short temp_short;
float temp_float;
float floatData[number_of_sample];

for (int i=0; i < number_of_sample; i++)
  memcpy(&temp_short, &src[i*2], 2);
  temp_float = temp_short;
  floatData[i] = temp_float;


Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 

More information about the Speex-dev mailing list