<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" 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 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Trebuchet MS";
        color:navy;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Trebuchet MS";
        color:navy;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:926957558;
        mso-list-template-ids:254187522;}
@list l0:level1
        {mso-level-start-at:3;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l1
        {mso-list-id:1173839169;
        mso-list-template-ids:-1345058388;}
@list l1:level1
        {mso-level-start-at:2;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l2
        {mso-list-id:1722897922;
        mso-list-template-ids:-1848313052;}
@list l3
        {mso-list-id:1811820760;
        mso-list-type:hybrid;
        mso-list-template-ids:2137455738 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l3:level1
        {mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'>Hi All<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'>I am using
speex in one of my WinCE project.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>I have been trying to use speex to perform denoise on the captured
audio packet and echo cancellation. Following behavior I have observed while using
various options. I would really appreciate if you could help me with the issues
I am facing.<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'><o:p>&nbsp;</o:p></span></font></p>

<ol style='margin-top:0in' start=1 type=1>
 <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo3;text-autospace:
     none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:
     10.0pt;font-family:"Trebuchet MS"'>Denoise: I have written the following
     to code to perform denoise.<o:p></o:p></span></font></li>
</ol>

<p class=MsoNormal style='margin-left:1.0in;text-autospace:none'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>//To initialize speex preprocess state and set the denoise option<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'>int nEnable = 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SpxPreprocessState = speex_preprocess_state_init(160, 8000); //20ms audio at
8000 bps<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'>speex_preprocess_ctl(SpxPreprocessState,
SPEEX_PREPROCESS_SET_DENOISE, &amp;nEnable);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'>//Run the preprocess on the buffer
captured before encoding<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'>speex_preprocess_run(SpxPreprocessState,
(short*)pbBuffer);<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
speex_encode_int(EncoderState,(short*)pbBuffer, &amp;stSpeexBits); <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>On calling speex_preprocess_run removes all the audio from the
buffer and a constant humming sound is heard. I open the recorded file in Cool
edit pro tool and see that all the spikes are removed and flat wave is there.
What could be the reason for this behavior?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=black face="Trebuchet MS"><span
style='font-size:10.0pt;font-family:"Trebuchet MS";color:black'><o:p>&nbsp;</o:p></span></font></p>

<ol style='margin-top:0in' start=2 type=1>
 <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo3'><font size=2
     color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
     "Trebuchet MS"'>Echo cancellation: I have two separte threads, one to
     capture live audio and another one to playback the audio recvevied on the
     network. Since audio capture and playback are handled asynchronously I
     call the function <b><i><span style='font-weight:bold;font-style:italic'>speex_echo_playback</span></i></b>
     right after I enqueue a buffer for sound card to play and call the
     function <b><i><span style='font-weight:bold;font-style:italic'>speex_echo_capture</span></i></b>
     for every packet captured before I call <b><i><span style='font-weight:
     bold;font-style:italic'>speex_encode_int</span></i></b> for encoding. As
     soon as the audio start I see below warnings on the screen<o:p></o:p></span></font></li>
</ol>

<p class=MsoNormal style='text-indent:.5in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><i><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black;font-style:italic'>Warning: No playback frame available (your
application is buggy and/or got xruns)<o:p></o:p></span></font></i></p>

<p class=MsoNormal style='text-indent:.5in'><i><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black;font-style:italic'>Warning: Auto-filling the buffer (your application
is buggy and/or got xruns)<o:p></o:p></span></font></i></p>

<p class=MsoNormal style='text-indent:.5in'><i><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>These warning are displayed few times and then it stops. Then once
in a while again these warnings are printed. What exactly do these warning
means as the audio keeps on playing without any problem?<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></font></p>

<ol style='margin-top:0in' start=3 type=1>
 <li class=MsoNormal style='color:black;mso-list:l3 level1 lfo3'><font size=2
     color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
     "Trebuchet MS"'>For AGC: <o:p></o:p></span></font></li>
</ol>

<p class=MsoNormal style='margin-left:1.0in;text-autospace:none'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>//To initialize speex preprocess state and set the AGC option<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in;text-autospace:
none'><font size=2 color=black face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS";color:black'>int nEnable = 1;<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-autospace:none'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SpxPreprocessState = speex_preprocess_state_init(160, 8000); //20ms audio at
8000 bps<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>speex_preprocess_ctl(g_pSpxPreprocessState, SPEEX_PREPROCESS_SET_AGC,
&amp;nEnable);<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=black
face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>On enabling AGC I get the below warning.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><i><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black;font-style:italic'>Warning: Unknown speex_preprocess_ctl request: 2<o:p></o:p></span></font></i></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><i><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black;font-style:italic'><o:p>&nbsp;</o:p></span></font></i></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:.5in'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>Is AGC not supported?<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.5in'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.5in'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>Thanks &amp; Regards<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.5in'><font size=2
color=black face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS";
color:black'>Gurinder<o:p></o:p></span></font></p>

</div>

_____________________________________________________________________ 
<br> <br>
This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@patni.com and delete this mail. <br>
_____________________________________________________________________
</body>

</html>