Hello all. I am able to programmatically decode speex just fine (playing others' encodings), but my encoding eats the beginning of words. If I encode a word that gradually increases in volume, like "wonderful", I hear "nderful", but if I encode something percussive like "beep" I hear almost all of it. It's as if the modeller does not detect the start of a word. Has anyone seen this before?
<br><br>In case you're interested here is the init code:<br><br><br> int quality = 3;<br> int off = 0;<br><br> speex_bits_init(&encoderBits);<br> encoder = speex_encoder_init(&speex_nb_mode);<br> speex_encoder_ctl( encoder, SPEEX_GET_SAMPLING_RATE, &sampleRate );
<br> speex_encoder_ctl( encoder, SPEEX_GET_FRAME_SIZE, &frameSize);<br><br> preprocess = speex_preprocess_state_init( frameSize, sampleRate );<br> speex_preprocess_ctl( preprocess, SPEEX_SET_QUALITY, (void*)&quality);
<br><br> speexRecordData = (char*)malloc(frameSize*sizeof(char)*CHANNELS); // 2 channels, input and output<br><br><br>and the encoding code:<br><br><br> speex_bits_reset( &encoderBits );<br> if ( speex_preprocess( preprocess, (short*)recording.data(), 0 ) &&
<br> speex_encode_int( encoder, (short*)recording.data(), &encoderBits ) ) // encode to speex<br> {<br> int numBytes = speex_bits_write( &encoderBits, speexRecordData, frameSize );<br> ...
<br><br><br>Thanks in advance for your insight.<br><br><br><br><br>yx<br>