Skip to content

Instantly share code, notes, and snippets.

@maxlapshin
Created March 30, 2010 21:06
Show Gist options
  • Select an option

  • Save maxlapshin/349594 to your computer and use it in GitHub Desktop.

Select an option

Save maxlapshin/349594 to your computer and use it in GitHub Desktop.
speex_bits_init(&driver->bits);
driver->encoder = speex_encoder_init(&speex_wb_mode);
driver->decoder = speex_decoder_init(&speex_wb_mode);
speex_decoder_ctl(driver->decoder, SPEEX_GET_FRAME_SIZE, &driver->frame_size);
speex_decoder_ctl(driver->decoder, SPEEX_GET_SAMPLING_RATE, &driver->sample_rate);
driver->den = speex_preprocess_state_init(driver->frame_size, driver->sample_rate);
// for each frame:
spx_int16_t rec[SPX_SIZE];
int size;
// ei_decode_binary(input, &ptr, rec, &size); <- extracting data
// size is 10 or 52 bytes
int was_speech = speex_preprocess_run(driver->den, rec);
//here get trash in rec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment