Displaying 1 result from an estimated 1 matches for "encodedarray".
2009 Apr 13
0
encoding -> decoding doesnt work
...tal = 0;
char *encoded = NULL;
for( int j = 0; j < amountSamples/frame_size; j++ )
{
// Encode the voice data
speex_bits_reset(&bits);
speex_encode_int(enc_state, (short*)((char*)p_raw1 +
j*frame_size*sizeof(short)), &bits);
int nBytes = speex_bits_nbytes(&bits);
char *encodedArray = new char[nBytes];
int encodedBytes =
speex_bits_write(&bits,encodedArray,nBytes);
printf("Encoded: %d \t",encodedBytes);
total += encodedBytes;
encoded = (char*)realloc( encoded, total );
memcpy( (encoded+total-encodedBytes), encodedArray,
encodedBytes );
}
printf("...