title: How to set Audio Sampling rate higher than 44.1kHz on linux/android platform?
body: <p>I noticed that <code>android.media.AudioRecord</code> failed to work
  when using wrong <code>sampleRateInHz</code></p>
  
  <h3>REPRODUCE</h3>
  
  <p>You can also reproduce easily that issue 
  using pcmrecorder on Samsung Nexus S (by Google) :</p>
  
  <p><a href="https://market.android.com/details?id=com.kohei.android.pcmrecorder" rel="nofollow">https://market.android.com/details?id=com.kohei.android.pcmrecorder</a></p>
  
  <p><a href="http://ko-yasui.com/home/pcmrecorder/" rel="nofollow">http://ko-yasui.com/home/pcmrecorder/</a></p>
  
  <p>So It fails to record at 48Khz while the hardware audio chip supports up to 96KHz :</p>
  
  <p><a href="http://www.wolfsonmicro.com/products/audio_hubs/WM8994/" rel="nofollow">http://www.wolfsonmicro.com/products/audio_hubs/WM8994/</a></p>
  
  <p>Is this a device/firmware bug or known limitation?</p>
  
  <p>Note that the android platform only ensure about 44100Hz (not even 24KHz)</p>
  
  <p><a href="http://developer.android.com/reference/android/media/AudioRecord.html" rel="nofollow">http://developer.android.com/reference/android/media/AudioRecord.html</a></p>
  
  <blockquote>
    <p><code>sampleRateInHz</code>: the sample rate expressed in Hertz. 44100Hz is currently the only rate 
    that is guaranteed to work on all devices, but other rates such as 22050, 16000, and 11025 may work on some devices.</p>
  </blockquote>
  
  <h3>SOURCE CODE</h3>
  
  <p>You'll find a sample code to reproduce those issues at : </p>
  
  <p><a href="https://github.com/rzr/rzr-android-test/blob/api-android-media/src/fr/online/rzr/test/" rel="nofollow">https://github.com/rzr/rzr-android-test/blob/api-android-media/src/fr/online/rzr/test/</a></p>
  
  <h3>TRACKS</h3>
  
  <p>How to overcome this limitation ? </p>
  
  <ul>
  <li><p>could any other API be used ? opensl, alsa, openal ? and how ?</p></li>
  <li><p>could alsa driver be reconfigured from user side 
  to be able to sample above 44100Hz ? ( .asoundrc )</p></li>
  <li><p>Is it possible to do a such thing 
  without reflashing/rooting/rebooting the device</p></li>
  <li><p>else how to workaround this ?
  upsampling (interpolation) efficiently, using native code ?</p></li>
  </ul>
  
  <h3>MORE</h3>
  
  <p><a href="http://www.anddev.org/multimedia-problems-f28/how-to-set-audio-sampling-rate-higher-than-44-1hz-nexuss-t54722.html" rel="nofollow">http://www.anddev.org/multimedia-problems-f28/how-to-set-audio-sampling-rate-higher-than-44-1hz-nexuss-t54722.html</a></p>
  
  <p><a href="http://en.androidwiki.com/wiki/Nexus_S" rel="nofollow">http://en.androidwiki.com/wiki/Nexus_S</a></p>