Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I record 2 microphone in Android simultaneously?

I'm trying to record audio signals from 2 in-built microphone(bottom, top) at the same time. I can pick up bottom microphone signal using

MediaRecorder.AudioSource.MIC

and top microphone signal using

MediaRecorder.AudioSource.CAMCORDER

I can record separately but I want to record at the same time from 2 microphones. Does anyone know how to record simultaneously? I tried & or | operator but I can get only 1 channel signal.

I use Galaxy S2 device.

I will appreciate any response :) Thanks in advance.

like image 690
Youna Ji Avatar asked Jan 31 '13 13:01

Youna Ji


People also ask

Can I use 2 microphones at the same time?

Both the microphone and the receiver must be on the same frequency in order to interact with each other. It is not possible for two microphones to be sending a signal to a single receiver at the same time.

Can you record vocals with two mics?

Decide on Mic Placement If you do want the two mics to be virtually exchangeable, keep their capsules close together while keeping them in phase as much as possible so that the vocal hits them at the same time. Many engineers will flip one mic upside down and position them grille-to-grille nearly touching.


2 Answers

There is a misconception that in devices with 2 microphones, both the microphones will be used when recording in the stereo mode.

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.

like image 57
Ritesh Singh Avatar answered Sep 17 '22 15:09

Ritesh Singh


You can achieve this by doing a stereo recording using the AudioRecord (http://developer.android.com/reference/android/media/AudioRecord.html) class. Have a look at How to access the second mic android such as Galaxy 3.

Specifying the audio format as stereo and the audio source as the camcorder automatically selects two microphones, one for each channel, on a (compatible) two microphone device.

For example:

            audioRecorder = new AudioRecord(MediaRecorder.AudioSource.CAMCORDER,sampleRate,android.media.AudioFormat.CHANNEL_CONFIGURATION_STEREO,android.media.AudioFormat.ENCODING_PCM_16BIT,bufferSize);

will initialise a new AudioRecord class, that can record from two device microphones in stereo in PCM, 16 bit format.

For more help on recording using AudioRecord (to record .wav), have a look at: http://i-liger.com/article/android-wav-audio-recording.

like image 38
Dave_S Avatar answered Sep 17 '22 15:09

Dave_S