<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<br><br>I am trying to develop a command line utility on PC side which will decode the encoded speex file without any header - ie. raw speex encoded data. <br><br>I downloaded the speex-1.2rc1 version and used the testenc.c under libspeex library. Just to make sure that things are working fine, encoded a .raw audio file and could get the .bit and decoded audio raw file which was validated by using a raw to wav converter and playing on PC.<br><br>I modified the same code to make an independent decode utility and facing the following issue.. I could find that each time 160 samples are encoded, there are 26 bytes of encoded speex data, hence read 26 bytes of encoded data from file and processed as shown below.. But it gives error like - Invalid mode and stream got corrupted...What could be the reason? Also how do I calculate the number of speex bytes to be
decoded at a given time.. Any help will be appreciated..<br><br>while (!feof(fin))<br> {<br> fread(tempd, 1, 26, fin);<br><br> if (feof(fin))<br> break;<br> speex_bits_reset(&bits);<br><br> speex_bits_read_from(&bits, tempd, 26); <br><br> speex_bits_rewind(&bits);<br><br> speex_decode_int(dec, &bits, out_short);<br><br>fwrite(&out_short[skip_group_delay], sizeof(short), FRAME_SIZE-skip_group_delay, fout);<br> skip_group_delay = 0;<br><br><br><br><br><br>Regards,<br>Kumar<br><br></td></tr></table><br>
<!--1--><hr size=1></hr>
Your Mail works best with the New Yahoo Optimized IE8. <a href="http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yahoo.com/in/internetexplorer/" target="_blank">Get it NOW!</a>.