1

i am trying to cancel echo but couldn't able to cancel even using a very simple example.Frame size 160 Tile Length 100

audioRecord.read(mic,0,mic.length);
audioData = speex.encode(mic,0,mic.length);
speakerData=speex.decode(audioData);
audioTrack.write(speakerData, 0, speakerData.length);
speex.DoAEC(mic,speakerData,outref);
fos.write(outref);

why above code example didn't cancel echo did i miss anything? When i play the file no echo was removed.

also following simple example didn't work still echo is there.

    short[] buf=new short[160];
audioRecord.read(buf,0,buf.length);
if(sData==null){
sData=buf;
}
short[] outref=new short[160];

speex.cancelecho(buf,sData,outref);
audioTrack.write(outref, 0, outref.length);
sData=buf;
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Sureshkumar Menon
  • 1,165
  • 7
  • 27
  • 49

1 Answers1

0

You need to understand the requirements for the AEC to work - all documented in the Speex docs - and know how to debug your flow to achieve that.

You can get more pointers from my answer here: Android Speex echo cancellation problems

Also, I have a project that does a loopback sample of Speex AEC - video coverage is here: http://www.youtube.com/watch?v=e1-HwidHMy0

It's a whole project so no point in trying to squeeze it to an answer, but the pointers I gave should give you a start - and the video proves it's possible.

Community
  • 1
  • 1
SirKnigget
  • 3,614
  • 2
  • 28
  • 61
  • hey can u please resolve my issue...i have been stuck for almost 1 week...and i cant bale to find any solution..here is the link http://stackoverflow.com/questions/23010325/android-echo-cancelation-via-speex-library – Sarfaraz Khan Apr 28 '14 at 12:32