No matter I speex_echo_playback the received voice data(from far end) right before it&#39;s played by waveout or right after it&#39;s played, it cann&#39;t cancel any echo.<br><br>I read the documentation again and again,found I am indeed following the instruction.<br>
<br><div class="gmail_quote">2010/6/28  <span dir="ltr">&lt;<a href="mailto:fanchuan0077@gmail.com">fanchuan0077@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello, all.<br><br>1) ACE does not work for me<br>    I am in a voip project using Speex, failed to have hte Speex ACE work. here is how I initialize it:<br>        /**<br>         *   Configurations :<br>         *   #define BITS_PER_SAMPLE                (16)<br>
         *   #define SAMPLE_RATE                (8000)<br>         *   #define        CHANNEL_NB                        (1)<br>         *   #define DURATION                        (20)<br>         *    SPEEX_MODEID_NB<br>         */<br>        _eco_state = speex_echo_state_init(_encframe_size, 10*_encframe_size);<br>
        speex_echo_ctl(_eco_state, SPEEX_ECHO_SET_SAMPLING_RATE, &amp;_sample_rate);<br><br>        _den_state = speex_preprocess_state_init(_encframe_size, _sample_rate);<br>        speex_preprocess_ctl(_den_state, SPEEX_PREPROCESS_SET_ECHO_STATE, _eco_state);<br>
<br>        tmp=1;<br>        speex_preprocess_ctl(_den_state, SPEEX_PREPROCESS_SET_DENOISE, &amp;tmp);<br>        tmp=1;<br>        speex_preprocess_ctl(_den_state, SPEEX_PREPROCESS_SET_AGC, &amp;tmp);<br>        ftmp=24000;        // actually default is 8000(0,32768),here make it louder for voice is not loudy enough by default. 8000<br>
        speex_preprocess_ctl(_den_state, SPEEX_PREPROCESS_SET_AGC_LEVEL, &amp;ftmp);<br>        tmp=1;<br>        speex_preprocess_ctl(_den_state, SPEEX_PREPROCESS_SET_VAD, &amp;tmp);<br><br>and following is how I cancel echo:<br><br>I have a player class and a recorder class using windows wavein and waveout with waveInProc and waveOutProc event handlers<br>
<br>void __stdcall WFAudioPlayer::WaveOutProc(HWAVEOUT hWaveOut,UINT uMsg,DWORD dwInstance,DWORD dwParam1,DWORD dwParam2)<br>{<br>        if(uMsg != WOM_DONE)<br>                return;<br><br>        WFAudioPlayer* player = reinterpret_cast&lt;WFAudioPlayer*&gt;(dwInstance);<br>
<br>        if (player)<br>        {<br>                // get the frame to be played back next.<br>                tByte* nextframe = player-&gt;GetNextBlockFrame();<br><br>                /**<br>                 * No matter the following two lines are commented or not, the voip performances are the same, with echo.<br>
                 */ <br>               // make speex AEC buffer it for echo cancellation for recorder<br>                if (nextframe)                                                                                     <br>                        player-&gt;GetConverter()-&gt;SpeexEchoPlayback(nextframe);<br>
        }<br>        ......<br>}<br><br>void WFAudioRecorder::ProcessRecordedFrame(tByte* record)<br>{<br>        static tUInt32 timestamp_counter = 0;<br><br>         // cancel echo<br>        _converter-&gt;SpeexEchoCapture(record,_echooutframe);<br>
<br>        //preprocess<br>        _converter-&gt;SpeexPreprocessRun(_echooutframe);<br>        ........<br>}<br>and ACE seems not work for me at all. I don&#39;t know why. the voices are the same whether I cancel echo or not,full of echos.<br>
<br>Any help would be appreciated, thanks.<br><br>2)<br>BTW speex_echo_state_destroy crashes if the echo state was initialized with filter length 0.<br>_eco_state = speex_echo_state_init(_encframe_size, 0);<br>I know it&#39;s unreasonable to make filter length 0, but crash is unacceptable, I think.</blockquote>
</div><br><br clear="all"><br>-- <br>B.r<br>Sincerly Dongwen<br>