Displaying 1 result from an estimated 1 matches for "compr_length".
2009 Jan 20
0
VoIP with wavefrom and speex
...d to add the speex compression, but I always get a crash when I try to decode the data.
Here is my encode and decode function:
int audio_encode(char dest[],WAVEHDR *source,int srclen, int quality)
{
SpeexBits bits;
void *enc_state;
float input[160];
char output[200];
unsigned int i,n=0;
int compr_length = 0;
unsigned short length;
speex_bits_init(&bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&quality);
while(1)
{
for(i=0;i<160;i++)
{
if(n>=srclen)
{
speex_bits_destroy(&bits);
speex_encoder_destro...