0
votes

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
You're passing AudioFormat.CHANNEL_IN_MONO to the AudioRecord constructor.Michael
Sorry, it's a typo when I'm writing up the question. Already changed it. I'm pretty sure I'm getting stereo data back since I can separate them nicely into two channels.James
On every phone with two mics that I've worked with in the last couple of years it's been sufficient to request 2 channels (i.e. CHANNEL_IN_STEREO). The one exception I can think of is the XPeria P which gave you dual mono if you used the CAMCORDER 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

1 Answers

0
votes

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.