[Speex-dev] Continous decoding of several audio files without destroying speex_decoder

Sumin Seo giganti71 at gmail.com
Fri Dec 21 17:18:45 PST 2007


Hi All,

We are using speex decoder only for narrow band decoding.
Quite often, even though source frame is not silence, decoded audio is
silence.
I wonder there is a problem in the way we uses speex decoder API.
Basically, we initialize speex decoder only once and just reset the decoder
before we decoding another file.
Do we need to intialize speex decoder and destory decoder for each audio
file decoding ?

Here is current pseudo code.
main()
{
m_speex = speex_decoder_init(speex_nb_mode);
speex_decoder_ctl(m_speex, SPEEX_SET_ENH, &tmp);
speex_bits_init(&m_bits);

while(end of files)
{
   speex_decoder_ctl(m_speex, SPEEX_RESET_STATE, &tmp);
   speex_bits_reset(&m_bits);

   OpenFile(speex audio file);
   while(end of file)
   {
       fread(speex frame);
      speex_bits_read_from();
      speex_decode_int();
      fwrite(decoded audio);
   }
   CloseFile(speex audio file);
}

speex_decoder_destroy();
speex_bits_destroy();
}

Thanks in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20071221/735ce2cf/attachment.htm


More information about the Speex-dev mailing list