[Speex-dev] Trouble in decoding speex on PC

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Thu Jan 28 03:13:41 PST 2010


Have you tried starting from sampleenc.c/sampledec.c (see manual)?

	Jean-Marc

On 2010-01-28 05:45, Kumar Vply wrote:
> Hi,
>
> 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.
>
> 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.
>
> 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..
>
> while (!feof(fin))
> {
> fread(tempd, 1, 26, fin);
>
> if (feof(fin))
> break;
> speex_bits_reset(&bits);
>
> speex_bits_read_from(&bits, tempd, 26);
>
> speex_bits_rewind(&bits);
>
> speex_decode_int(dec, &bits, out_short);
>
> fwrite(&out_short[skip_group_delay], sizeof(short),
> FRAME_SIZE-skip_group_delay, fout);
> skip_group_delay = 0;
>
>
>
>
>
> Regards,
> Kumar
>
>
> ------------------------------------------------------------------------
> Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!
> <http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yahoo.com/in/internetexplorer/>.
>
>
>
>
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev


More information about the Speex-dev mailing list