<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"\0422\0435\043A\0441\0442 \0432\044B\043D\043E\0441\043A\0438 \0417\043D\0430\043A";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.a
        {mso-style-name:"\0422\0435\043A\0441\0442 \0432\044B\043D\043E\0441\043A\0438 \0417\043D\0430\043A";
        mso-style-priority:99;
        mso-style-link:"\0422\0435\043A\0441\0442 \0432\044B\043D\043E\0441\043A\0438";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:RU;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=RU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>So in your case if you don&#8217;t want to use </span><b><span style='font-size:10.5pt;color:black'>speex_echo_cancellation</span></b><b><span style='font-size:10.5pt;color:black'> </span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>than you should do next way:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Save the playback frames (clean echo) within separate playback thread with </span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>speex_echo_playback</span></b></span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'> </span></b></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>func.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Then use </span>speex_echo_capture<span lang=EN-US> - </span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>it will remove the clean echo frame (saved with </span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>speex_echo_playback</span></b></span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'> </span></b></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>func) from<o:p></o:p></span></p><p class=MsoNormal>const spx_int16_t *rec <span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>buffer (saved with </span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>speex_echo_</span></b></span><span class=apple-style-span><b><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>capture)</span></b></span><span class=apple-style-span><b><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'> </span></b></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>and you will get clean frame in &quot;out&quot; buffer.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The sync is very important - because </span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>speex_echo_</span></b></span><span class=apple-style-span><b><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>capture </span></b></span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>won't be able to remove clean echo frame that you didn't provide with </span><span class=apple-style-span><b><span style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>speex_echo_playback</span></b></span><span class=apple-style-span><b><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'>.<o:p></o:p></span></b></span></p><p class=MsoNormal><span class=apple-style-span><b><span lang=EN-US style='font-size:10.5pt;font-family:"Arial","sans-serif";color:black'><o:p>&nbsp;</o:p></span></b></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I hope I didn't messed up anything :)</span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Anton A. Shpakovsky<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Christopher Adoremos [mailto:chrisadoremos@gmail.com] <br><b>Sent:</b> Thursday, September 30, 2010 11:52 AM<br><b>To:</b> Anton A. Shpakovsky<br><b>Cc:</b> speex-dev@xiph.org<br><b>Subject:</b> [SPAM] [BombData][alltestmode] Re: [SPAM] [BombData][alltestmode] [Speex-dev] Using Speex Echo Canceller<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Anton<br><br>Thanks for the info...<br><br>What if I use this function do I still need to sync the playback and capture?<br>Assuming that the captured voice (*rec) already contains the echo which I need to cancel out...<br>--------------------------------<br>void speex_echo_capture (SpeexEchoState *st, const spx_int16_t *rec,&nbsp; spx_int16_t *out)<br><br>Parameters:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; st&nbsp;&nbsp;&nbsp;&nbsp; Echo canceller state<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rec&nbsp;&nbsp;&nbsp;&nbsp; signal from the microphone (near end + far end echo)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; out&nbsp;&nbsp;&nbsp;&nbsp; Returns near-end signal with echo removed<br>----------------------------------&nbsp;&nbsp; <br><br>thanks &amp; regards,<br>Chris Adoremos<o:p></o:p></p><div><p class=MsoNormal>On Wed, Sep 29, 2010 at 5:46 PM, Anton A. Shpakovsky &lt;<a href="mailto:saa@tomsksoft.com">saa@tomsksoft.com</a>&gt; wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Hi</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Yes, it's absolutely unnecessary to use speex codec. You can encode the echo cancelled auido data</span><span lang=EN-US style='font-size:10.0pt;color:#333333'> with any codec you want.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:10.0pt;color:#333333'>The Echo Canncelation API is here - </span><a href="http://www.speex.org/docs/api/speex-api-reference/group__SpeexEchoState.html" target="_blank">http://www.speex.org/docs/api/speex-api-reference/group__SpeexEchoState.html</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>I would advice you to look at </span><b><span style='font-size:10.5pt;color:black'>speex_echo_cancellation </span></b><span lang=EN-US>function but you will have to sync playback and capture streams by yourself.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US>I've used GSM, iLBC and Speex codecs with Speex AEC and it works fine.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Best Regards,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Anton A. Shpakovsky</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a href="mailto:speex-dev-bounces@xiph.org" target="_blank">speex-dev-bounces@xiph.org</a> [mailto:<a href="mailto:speex-dev-bounces@xiph.org" target="_blank">speex-dev-bounces@xiph.org</a>] <b>On Behalf Of </b>Christopher Adoremos<br><b>Sent:</b> Wednesday, September 29, 2010 4:39 PM<br><b>To:</b> <a href="mailto:speex-dev@xiph.org" target="_blank">speex-dev@xiph.org</a><br><b>Cc:</b> <a href="mailto:jean-marc.valin@usherbrooke.ca" target="_blank">jean-marc.valin@usherbrooke.ca</a><br><b>Subject:</b> [SPAM] [BombData][alltestmode] [Speex-dev] Using Speex Echo Canceller</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is it possible to use only the speex echo cancellation module w/o using the speex codec?<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Here's the scenario:<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>1. I have my voice recorded in PCM audio file format<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>2. I want to cleanup the recorded voice by removing any echo included in the audio file/buffer<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>3. can I just use the ff APIs?<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;&nbsp; - SpeexEchoState* speex_echo_state_init()<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;&nbsp; - int speex_echo_ctl()<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;&nbsp; - void speex_echo_capture()<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>4. then, will it be possible to encode the output buffer from speex_echo_capture() to any codec?<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;&nbsp; &nbsp;Like G711? GSM? etc....<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I'm quite new to audio format concepts/development, so if you have any ideas your advice is highly appreciated..<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks in advance<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Chris A<o:p></o:p></p></div></div></div></div></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>