Android stereo recording. Accurate data from two different channels

I am trying to make stereo recording from my Galaxy Nexus phone. According to its characteristics, the phone has 2 built-in microphones. Correct me if I'm wrong, 2 microphones will be used if the device supports stereo recording

I am not getting any errors when initializing and using the AudioRecord class to record stereo audio. But the results I get from the two audio channels are exactly the same. Has anyone faced the same problem before? Any ideas? Thank. The following piece of code is what I am using to set up the stereo recording:

            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();

      

0


source to share


1 answer


Correct me if I'm wrong, 2 microphones will be used when stereo support is supported on the device

In my 3 years of experience testing on dozens of devices, I found this never happened.



Main microphone used in both mono and stereo recordings on a wide range of Android devices I've worked with - from inexpensive mainstream models to flagships.

One of the reasons for this is that the primary microphone is of better quality (more sensitive, less noisy, etc.) and is more expensive than the secondary microphone.

0


source







All Articles