Hi all,
I'm working on an application that needs to perform recognition algorithms on raw PCM audio captured from the microphone. On all Android devices I've tested, the PCM data is usable (i.e., raw audio data.) This is not the case for the new Sprint EVO.
The Sprint EVO has AGC (Auto Gain Control) on the mic, which destroys the data such that our recognition algorithms no longer work.
I believe this is a feature that HTC added to the OS for this device (and possibly future devices.) I've tested our application on a few other devices using the same OS version (2.1) and these other devices behave normally.
Unfortunately, HTC has not yet posted the code used on this device. I expect that I may have to use JNI in order to bypass this for this specific device, and I'm willing to do this, but without access to the HTC source, I wouldn't know where to begin.
There is no way to reverse the effects of AGC, so I'm stuck trying to work around it.
More specific information:
I'm using AudioRecorder in order to get access to the raw PCM data. I've tried a few programs that use MediaRecorder to record AMR data and those recordings also exhibit the same AGC properties.
One thing I have yet to try, is to write my own routines to use MediaRecorder and use setAudioSource(AudioSource.VOICE_RECOGNITION). The only documentation I can find on this flag is from the Android reference, which simply states "Microphone audio source tuned for voice recognition if available, behaves like DEFAULT otherwise." This may be what I need, but would require the extra step of decoding the AMR data in order to get the PCM data (which I'll do if I have to.)
If anybody knows anything about this new "feature", any information would be greatly appreciated. Specifically, my life would be much better if I had the answers to any of the following questions:
- Is this new feature specific to HTC?
- When will HTC release their codebase for the EVO/Supersonic?
- Has anybody else run into this and found a way to work around the issue?
- Does AudioSource.VOICE_RECOGNITION actually prevent AGC?
- Does the existence of AudioSource.VOICE_RECOGNITION indicate that this is expected to be more common in future devices and this flag is a provision for bypassing it?
Any other clues, hints, tips would be greatly appreciated.