[speex-dev] Invalid mode encountered: corrupted stream?
Fabio
fabpet at aliceposta.it
Tue Feb 24 02:48:49 PST 2004
Hi,
in my application i quite often (not allways) get those two warning:
"Invalid mode encountered: corrupted stream?"
"Invalid wideband mode encountered: corrupted stream?"
The stream is not corrupted but i wish to know what those warning mean to
correct my code.
My encode and decode routines are those (libspeex 1.1.4):
SpeexBits enc_bits, dec_bits;
void *enc_state, *dec_state;
static int enc_nbBytes = 0;
static int comp = 1, quality = 5;
static int vero = 1, falso = 0;
static int enc_bitrate = 8000;
void SpeexInit (void)
{
//ENCODER
speex_bits_init(&enc_bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,SPEEX_RESET_STATE,NULL);
speex_encoder_ctl(enc_state,SPEEX_SET_COMPLEXITY,&comp);
speex_encoder_ctl(enc_state,SPEEX_SET_QUALITY,&quality);
speex_encoder_ctl(enc_state,SPEEX_SET_BITRATE, &enc_bitrate);
speex_encoder_ctl(enc_state,SPEEX_SET_DTX, &vero);
<p> //DECODER
speex_bits_init(&dec_bits);
dec_state = speex_decoder_init(&speex_nb_mode);
speex_decoder_ctl(dec_state, SPEEX_RESET_STATE,NULL);
speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &falso);
}
void SpeexEncode(short *samples, char *encoded)
{
speex_bits_reset(&enc_bits);
speex_encode(enc_state, samples, &enc_bits);
enc_nbBytes = speex_bits_write(&enc_bits, encoded, 20);
}
void SpeexDecode(char *encoded, short *sample)
{
speex_bits_read_from(&dec_bits, encoded, 20);
speex_decode(dec_state, &dec_bits, sample);
}
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Speex-dev
mailing list