[speex-dev] openh323 conflict; can speex_encode take short?
    sean darcy 
    seandarcy at hotmail.com
       
    Sat Apr  3 17:04:18 PST 2004
    
    
  
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:
peexcodec.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*)'
<p>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
hort 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.
    
    
More information about the Speex-dev
mailing list