title: android cancel speakers output. Eliminate phone feedback
body: <p>I'm developing some speech recognition app. I need to recognize words when the phone is ringing, but to do this I must cancel the speakers contribution to the microphone. So i want the microphone to ignore all audio coming from the speakers. </p>
  
  <p>I've found that AcousticEchoCanceler is used for VoIP apps to cancel the echo, but I've tried to use it, and there's no difference when a tone is ringing on my phone.</p>
  
  <p>I'm reading the audio from an AudioRecord object called 'recorder', and then applying the AcousticAudioCanceler     </p>
  
  <pre><code>boolean isAvailable = AcousticEchoCanceler.isAvailable(); 
  if (isAvailable) { 
      AcousticEchoCanceler aec = AcousticEchoCanceler.create(recorder.getAudioSessionId());
      if(!aec.getEnabled())
           aec.setEnabled(true);
      Log.d("AEC", " AEC enabled : " + aec.getEnabled() + " . Has control: " + aec.hasControl()); 
  }
  else
      Log.d("AEC", " AEC is not available");
  </code></pre>
  
  <p>I'm getting the same input when applying the AcousticCanceler and when not applying it. Why? Maybe it doesn't control the audio when coming from another application? I need it to work cancelling any output from the speakers, independently from which app they come from.</p>
  
  <p>Furthermore, is AcousticAudioCanceler the only way to do this? I mean, it just works on Android Jelly Bean, and I need it to work on all devices... Thanks in advance</p>