问题
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();
回答1:
Correct me if I'm wrong, 2 microphones will be used when stereo recording is supported on the device
In my 3 years experience of testing on tens of devices, I have found that this was never the case.
The primary mic alone is used both in mono and stereo recording in the wide range of Android devices that I have worked with - from low-cost mass models to flagships.
One reason for this is that the primary mic is of a better quality (more sensitive, less noisy, etc.) and costlier than the secondary mic.
来源:https://stackoverflow.com/questions/17982714/android-stereo-recording-exact-same-data-from-two-different-channels