I noticed that android.media.AudioRecord
failed to work
when using wrong sampleRateInHz
REPRODUCE
You can also reproduce easily that issue using pcmrecorder on Samsung Nexus S (by Google) :
https://market.android.com/details?id=com.kohei.android.pcmrecorder
http://ko-yasui.com/home/pcmrecorder/
So It fails to record at 48Khz while the hardware audio chip supports up to 96KHz :
http://www.wolfsonmicro.com/products/audio_hubs/WM8994/
Is this a device/firmware bug or known limitation?
Note that the android platform only ensure about 44100Hz (not even 24KHz)
http://developer.android.com/reference/android/media/AudioRecord.html
sampleRateInHz
: 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.
SOURCE CODE
You'll find a sample code to reproduce those issues at :
https://github.com/rzr/rzr-android-test/blob/api-android-media/src/fr/online/rzr/test/
TRACKS
How to overcome this limitation ?
could any other API be used ? opensl, alsa, openal ? and how ?
could alsa driver be reconfigured from user side to be able to sample above 44100Hz ? ( .asoundrc )
Is it possible to do a such thing without reflashing/rooting/rebooting the device
else how to workaround this ? upsampling (interpolation) efficiently, using native code ?