Displaying 1 result from an estimated 1 matches for "lib_speex_encod".
Did you mean:
lib_speex_encode
2011 Jan 02
0
Newbie problem with encoding
...frame_sz() {
// Get the expected frame size
int sz;
if(enc_state == NULL) return -100;
speex_encoder_ctl(enc_state, SPEEX_GET_FRAME_SIZE, &sz);
return sz;
}
This returns 320 as the expected frame size.
1. I assume this is the block size I have to call the encoder with.
int lib_speex_encode(short *samples, char*encoded_bytes) {
// Encode the data
int bytes_written;
if(enc_state == NULL) return -100;
speex_bits_reset(&bits);
speex_encode_stereo_int(samples,320, &bits);
bytes_written = speex_bits_write(&bits, encoded_bytes, 1024);
return bytes_wr...