I am working on an application that should run recognition algorithms on raw PCM audio captured from a microphone. On all the Android devices I tested, PCM data can be used (i.e., the original audio data). This does not apply to the new Sprint EVO.
Sprint EVO has AGC (Auto Gain Control) on the microphone, which destroys data, so our recognition algorithms no longer work.
I believe this is a feature that HTC has added to the OS for this device (and possibly future devices). I tested our application on several other devices using the same OS version (2.1), and these other devices behave normally.
Unfortunately, HTC has not yet published the code used on this device. I expect that I may have to use JNI to get around this for this particular device, and I'm ready to do it, but without access to the HTC source, I don't know where to start.
It is not possible to change the effects of AGC, so I'm stuck trying to get around it.
More specific information:
I use AudioRecorder to access raw PCM data. I tried several programs that use MediaRecorder to record AMR data, and these records also demonstrate the same AGC properties.
One thing I still have to try is to write my own procedures to use MediaRecorder and use setAudioSource (AudioSource.VOICE_RECOGNITION). The only documentation I can find on this flag is the Android link, which simply says: "The microphone's sound source, configured to recognize voice, if available, behaves like DEFAULT otherwise." This may be what I need, but it will take an extra step to decode the AMR data to get the PCM data (which I will do if necessary).
If anyone knows anything about this new โfeature,โ any information would be greatly appreciated. In particular, my life would be much better if I had answers to any of the following questions:
- Is this a new feature for HTC?
- When will HTC release its code base for EVO / Supersonic?
- Has anyone else come across this and found a way around the problem?
- Does AudioSource.VOICE_RECOGNITION really prevent AGC?
- Does AudioSource.VOICE_RECOGNITION exist, which is expected to be more common in future devices, and is this flag a condition for circumventing it?
Any other hints, hints, hints are welcome.