2

Tried to create new audiorecord instances like

 mAudioInstance = new Record(MediaRecorder.AudioSource.MIC);
 mAudioInstanceSecond = new Record(MediaRecorder.AudioSource.CAMCORDER);

So when I tried to start recording I got the following warning message for second record instance "startInput() input failed: other input already started"

So I cant use second mic for recording, only able to record for first mic

Is there anyway to use two audio inputs for recording at a time for an anddoid device

Note : I am using Nexus 9 which have a mic port near camera, so I believe the second mic instance is a valid one.

JibinNajeeb
  • 784
  • 1
  • 10
  • 31

1 Answers1

0

You can do this by doing a stereo recording using the AudioRecord

(http://developer.android.com/reference/android/media/AudioRecord.html)

Refer this : https://stackoverflow.com/a/15418720/7795876

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.

Eg:-

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

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

Community
  • 1
  • 1
Saurav Prakash
  • 588
  • 1
  • 5
  • 26