title: Android/Xamarin Audio Recording/Encoding
body: <p>I'm currently coding an Android application with Xamarin and I'm using the AudioRecord class to record my audio.</p>
  
  <pre><code>audioRecord = new AudioRecord (
              // Hardware source of recording.
              AudioSource.Mic,
              // Frequency
              11025,
              // Mono or stereo
              ChannelIn.Mono,
              // Audio encoding
              Android.Media.Encoding.Pcm16bit,
              // Length of the audio clip.
              audioBuffer.Length
          );
  </code></pre>
  
  <p>But when it comes to choosing an Audio encoding, <code>Android.Media.Encoding</code> only has 4 options</p>
  
  <pre><code>Android.Media.Encoding.Default
  Android.Media.Encoding.Invalid
  Android.Media.Encoding.Pcm8bit
  Android.Media.Encoding.Pcm16bit
  </code></pre>
  
  <p><code>MediaRecorder</code> seems to have some <a href="http://developer.android.com/reference/android/media/MediaRecorder.AudioEncoder.html" rel="nofollow">more options</a> but no GSM option.</p>
  
  <p><strong>So here are my questions:</strong></p>
  
  <p><strong>1)</strong> Does anyone know of another recording option for android besides <code>AudioRecord</code> and <code>MediaRecorder</code> since neither seem to allow GSM by default? Maybe something in the <code>Android.Net.Rtp</code> API since it already has a GSM codec?</p>
  
  <p><strong>2)</strong> Or does anyone know a way to encode/decode audio to/from GSM using any of the current audio formats android lets you record to/play from?</p>
  
  <p><em>Alternative:</em> I could also be open to changing GSM to another format of similar size and quality to which I'm getting clear voice transmission at a rate of about 2 KB/s. However, that will require me to change my WinForms Desktop application which utilizes NAudio. So suggestions here are welcome if there is a good solution, however it would be better to find a solution to one of my other two questions.</p>