[speex-dev] openh323 conflict; can speex_encode take short?

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Sat Apr 3 20:29:35 PST 2004


The speex_decode function changed in 1.1.x and now takes shorts instead
of floats. However, since openh323 ships with it's own version of Speex,
I don't see why you're affected (are you trying to override the speex
code provided in openh323?). One way or another, you should be fine with
Speex 1.0.3.

        Jean-Marc

Le sam 03/04/2004 à 20:04, sean darcy a écrit :
> openh323 speexcodec.cxx has:
> 
> BOOL SpeexCodec::EncodeFrame(BYTE * buffer, unsigned & length)
> {
>   // convert PCM to float
>   float floatData[SAMPLES_PER_FRAME];
>   PINDEX i;
>   for (i = 0; i < SAMPLES_PER_FRAME; i++)
>     floatData[i] = sampleBuffer[i];
> 
>   // encode PCM data in sampleBuffer to buffer
>   speex_bits_reset(bits);
>   speex_encode(coder_state, floatData, bits);
> .................................
> 
> which does not compile on gcc-3.3.3:
> 
> speexcodec.cxx: In member function `virtual BOOL 
> SpeexCodec::EncodeFrame(BYTE*,
>    unsigned int&)':
> speexcodec.cxx:410: error: cannot convert `float*' to `short int*' for 
> argument
>    `2' to `int speex_encode(void*, short int*, SpeexBits*)'
> 
> 
> I think this due to the changes from 1.0 to 1..1 ( I'm using 1.1.4).
> 
> If I change:
> 
> float floatData[SAMPLES_PER_FRAME];
> 
> to
> 
> short floatData[SAMPLES_PER_FRAME];
> 
> it compiles.
> 
> There's an analogous call to speex_decode().
> 
> Is this just a stupid hack, or is this what Speex really wants?
> 
> thanks
> sean
> 
> _________________________________________________________________
> Check out MSN PC Safety & Security to help ensure your PC is protected and 
> safe. http://specials.msn.com/msn/security.asp
> 
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.

-- 
Jean-Marc Valin
http://www.xiph.org/~jm/
LABORIUS
Université de Sherbrooke, Québec, Canada


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Ceci est une partie de message numériquement signée.
Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20040403/4a99d171/signature-0001.pgp


More information about the Speex-dev mailing list