Hai Yun Tao
2007-Sep-27 02:13 UTC
[Speex-dev] Need some clarifications about "speex_preprocess_run"
Simple questions:1. when this method is called for each frame, do I have to call them twice for both the encode process and the decode process?2. does preprocessor do preprocessing on raw PCM data or on encoded speex data? I need to clarify this because i want to know when should I call this function, before the encoding process (i.e. preprocess the pcm data) or after the encoding process (i.e. the speex data)3. and if my questions is still not well understood, here is the encoding snippet and decoding snippet I have, which line should I insert "speex_preprocess_run", assume init and destroy are handled properly?encode part. . .speex_bits_reset(&bits);speex_encode_int(encoder, (spx_int16_t* )bytes, &bits);count = speex_bits_write(&bits, bytes, len);. . .decode part. . .speex_bits_read_from(&bits2, bytes, enc_count);speex_decode_int(decoder, &bits2, bytes);. . .Thanks in advanceHAI YUN TAO _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20070927/1db1e596/attachment.html
Jean-Marc Valin
2007-Sep-27 02:38 UTC
[Speex-dev] Need some clarifications about "speex_preprocess_run"
If you want to use the preprocessor (it's not required), then you need to run it on the audio before encoding. Jean-Marc Hai Yun Tao wrote:> Simple questions:1. when this method is called for each frame, do I have to call them twice for both the encode process and the decode process?2. does preprocessor do preprocessing on raw PCM data or on encoded speex data? I need to clarify this because i want to know when should I call this function, before the encoding process (i.e. preprocess the pcm data) or after the encoding process (i.e. the speex data)3. and if my questions is still not well understood, here is the encoding snippet and decoding snippet I have, which line should I insert "speex_preprocess_run", assume init and destroy are handled properly?encode part. > . > .speex_bits_reset(&bits);speex_encode_int(encoder, (spx_int16_t* )bytes, &bits);count = speex_bits_write(&bits, bytes, len);. > . > .decode part. > . > .speex_bits_read_from(&bits2, bytes, enc_count);speex_decode_int(decoder, &bits2, bytes);. > . > .Thanks in advanceHAI YUN TAO > _________________________________________________________________ > Connect to the next generation of MSN Messenger > http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline > > > ------------------------------------------------------------------------ > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev