I'm trying to do stereo recording from my galaxy nexus phone. By its spec, the phone has 2 microphones build-in. Correct me if I'm wrong, 2 microphones will be used when stereo recording is supported on the device
I get no errors initializing and using AudioRecord class to record stereo audio. But the results I'm getting from two audio channels are exactly the same. Has anyone encountered the same problem before? Any ideas? Thank you. The following code snippet is what I'm using for stereo recording setup:
int bufferRead = 0;
int bufferSize = AudioRecord.getMinBufferSize(44100,
AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT);
// if doesn't support that sampling frequency
if (bufferSize == AudioRecord.ERROR_BAD_VALUE
|| bufferSize == AudioRecord.ERROR) {
Log.i(this.toString(), "doesn't support sampling rate of "
+ frequency);
throw new IllegalArgumentException(
"entered unsupported audio sampling rate");
}
// grabbing 16-bit pcm audio
short[] tempBuffer = new short[bufferSize];
AudioRecord recordInstance = new AudioRecord(MediaRecorder.AudioSource.MIC,
44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT,
bufferSize);
recordInstance.startRecording();
AudioFormat.CHANNEL_IN_MONO
to theAudioRecord
constructor. – MichaelCHANNEL_IN_STEREO
). The one exception I can think of is the XPeria P which gave you dual mono if you used theCAMCORDER
audio source, due to the camera mechanics interfering with the secondary mic. I've never worked with an OMAP platform though, so I don't know how they generally do things. – Michael