Displaying 1 result from an estimated 1 matches for "fromfloat".
Did you mean:
fromflag
2004 Aug 06
0
Multiple Frames per Packet
...I've included some clips from my code below:
-david
---------------
// encode
void GSpeexEncoder::encode( const short* from, int fromSize,
vector<char>& to )
{
GASSERTPUB( );
GASSERTPRE( from && fromSize );
// First convert to floating-point data
static vector<float> fromFloat;
fromFloat.resize( fromSize );
const short* src = from;
float* dst = &fromFloat[0];
int c = fromSize;
while( c-- ) { *dst++ = (float)*src++; }
// Now encode as many times as many frames as are stored
speex_bits_reset( &_bits );
GASSERT( !( fromSize % _frameSize ) );
for( int frame = 0; fra...