AnsweredAssumed Answered

Speex Library

Question asked by Dav34 on Apr 22, 2014
Latest reply on Apr 22, 2014 by Dav34
Hi all,

I'm trying to use the speex library on a STMF205. I have downloaded the AN2812 and the stsw-stm32017 example.

I have copied code example into  my project  :

    /* Speex encoding initializations */
    enc_state = speex_encoder_init(&speex_nb_mode);
    speex_encoder_ctl(enc_state, SPEEX_SET_VBR, &vbr);
    speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY,&quality);
    speex_encoder_ctl(enc_state, SPEEX_SET_COMPLEXITY, &complexity);
    /* speex decoding intilalization */
    dec_state = speex_decoder_init(&speex_nb_mode);
    speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &enh);


    /* Flush all the bits in the struct so we can encode a new frame */
    /* Encode the frame */
    speex_encode_int(enc_state, (spx_int16_t*)IN_Buffer[0], &bits);
    /* Copy the bits to an array of char that can be decoded */
    speex_bits_write(&bits, (char *)out_bytes, ENCODED_FRAME_SIZE);
    /* Copy the encoded data into the bit-stream struct */
    speex_bits_read_from(&bits, (char *)out_bytes, ENCODED_FRAME_SIZE);
    /* Decode the data */
    speex_decode_int(dec_state, &bits, (spx_int16_t*)OUT_Buffer[0]);

The compilation is ok but I have a MemManage_Handler during the encoding.

Do you have anyone an idea ? As anyone already used this library (or another one) on STM32F205.

Thanks for all.