title: Android echo cancellation
body: <p>I'm trying to develop an Audio Capture application using the AudioRecord 
  class from android api, setting, how audio source a 
  MediaRecorder.AudioSource.MIC, the aplication works, but when I try to use 
  the echo cancellation, setting a
  MediaRecorder.AudioSource.VOICE_COMMUNICATION how source, when AudioRecorder object is 
  created, a IllegalArgumentException throws, but I don't know why:</p>
  
  <p>My code is:</p>
  
  <pre><code>private static final int SAMPLE_RATE = 16000;
  private static final int BIT_ENCODING = AudioFormat.ENCODING_PCM_16BIT;
  private static final int CHANNEL_CONFIGURATION = AudioFormat.CHANNEL_CONFIGURATION_MONO;
  
  private int m_i32BufferSize;
  
  private AudioRecord m_AudioRecorder;
  
  public caudioCapture ()
  {
      super ();
  
      m_i32BufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE, CHANNEL_CONFIGURATION, BIT_ENCODING);
  
      //Create audio recorder object 
      try
      {
          m_AudioRecorder = new AudioRecord (MediaRecorder.AudioSource.VOICE_COMMUNICATION,SAMPLE_RATE,CHANNEL_CONFIGURATION,BIT_ENCODING,m_i32BufferSize);
  
      }
      catch (IllegalArgumentException e)
      {
          throw new IllegalArgumentException("Bad arguments on AudioRecorder creation", e);
      }
  </code></pre>
  
  <p>In my android manifest I have:</p>
  
  <p>uses-permission android:name="android.permission.RECORD_AUDIO"</p>
  
  <p>Maybe it is because I'm using a Samsung galaxy tab p1000 and it run with android 2.2? Any idea?</p>
  
  <p>Thanks a lot</p>