I hope someone could help me with this issue.
Some time ago I developed an application in order to record simultaneously the sound captured by the front mic and the back one in a smartphone. Basically, I make the next object like this:
AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.CAMCORDER, frequency, AudioFormat.CHANNEL_IN_STEREO, audio encoding, buffer size);
It worked perfectly for a Sony Xperia Neo V but not for a Motorola Moto G (or Moto X I guess). Taking a look at the documentation I saw the next for the CAMCORDER flag:
Microphone audio source with same orientation as camera if available, the main device microphone otherwise.
Motorola Moto G does not have a camera mic but one in the top (Sony Xperia has one mic in the back or camera mic). In fact, with Moto G I got the same signal (the one captured by the front mic) twice, which is correct according to the documentation.
Can anybody help me?
I had the same problem, and I got it to work using a sample rate of 48000 Hz. I figured it would work since the video recordings made with the default camera app worked in stereo and had this sampling rate. This frequency must also be considered when using the function getMinBufferSize().
Here are my settings:
and then I create the AudioRecord object with:
I am using the Moto G, with KitKat installed.