[Speex-dev] tgAudioCodec.zip

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Mon Apr 4 19:23:06 PDT 2005


> Glad to hear there is a way now.  The problem I ran into predated that 
> feature though.  At some point, speex_preprocess got changed from 
> taking floats to ints.  Not a big deal for me, and I know it's part of 
> the unstable series, but it was a breaking change that I never knew 
> about until someone got compile errors with my class.

Yeah, I prefered to change it now, so that if the preprocessor is ever
converted to fixed-point I won't have to change it again or have two
versions of the functions like for encoding and decoding (float and
_int() version).

> I had tried to upgrade to a newer version of Speex myself, but I kept 
> getting weird problems where the decoder would flip out after awhile 
> (seemingly at random, and almost never on my PC), producing very loud 
> noise, and I'd have to restart the stream.  After some unsuccessful 
> debugging attempts I went back to the older version that has been very 
> solid for me.  I'm pretty sure the problem is on my end but I haven't 
> figured it out yet...

Would be nice if you did, just in case it's a problem with Speex.
Perhaps just tracking down when it happened could help.

> I thought it might be related to packing multiple frames together.  Can 
> you tell me if it's still ok to do speex_bits_init, call speex_encode 
> several times, then speex_bits_insert_terminator, then speex_bits_write + 
> speex_bits_destroy.  And then on the decoding side do speex_bits_init, 
> speex_bits_read_from, and loop on speex_decode until either it returns -1 
> or speex_bits_remaining returns <= 0?

Should be OK. Now, even just speex_bits_write() should even insert the
terminator for you. BTW, no need to init() and destroy(), you can just
just use reset(). As for speex_bits_remaining, it's not necessary
either, just the return value of speex_decode should be fine. If not, it
may be a bug (though I'd be surprised).

> Hmm, you and Ralph have convinced me to put it back online.  But I'll 
> have to review the code and strip out the application-specific stuff 
> I've added since then.  I suppose if I put a little more thought into 
> the instructions I include with it, things would probably be ok.  I 
> think I overreacted before anyway...

Good to hear :-)

	Jean-Marc

-- 
Jean-Marc Valin <Jean-Marc.Valin at USherbrooke.ca>
Université de Sherbrooke



More information about the Speex-dev mailing list