Displaying 1 result from an estimated 1 matches for "writing_pos".
2009 Jan 20
0
VoIP with wavefrom and speex
...2 Byte into dest
memcpy(&dest[compr_length],output,length);
compr_length += length;
}
}
int audio_decode(WAVEHDR *dest, char *source, int srclen)
{
SpeexBits bits;
float output[160];
void *dec_state;
unsigned int i;
unsigned int reading_pos = 0;
unsigned short length;
unsigned int writing_pos = 0;
//Decodiern:
speex_bits_init(&bits);
dec_state = speex_decoder_init(&speex_nb_mode);
while(reading_pos < srclen && writing_pos < 512)
{
length = bget_data(source,reading_pos,sizeof(short)); //get 2 Byte value from source
reading_pos += 2+length;
speex_bits_re...