Disable microphone of Headset & Enable microphone of device.

user609239 picture user609239 · Dec 20, 2012 · Viewed 15.5k times · Source

Can we differentiate between microphone of Headset & Android Device.

I am trying to record audio from microphone of device, but it routes the audio from the microphone of headset to android device. Is it possible that we can choose either to listen from mic of device or from mic of headset?

Please, help me. I will really appreciate.

Thanks.

Answer

Michael picture Michael · Dec 20, 2012

Not really. If you plug in a wired headset, its microphone will be used as the input for voice call and recordings by default.

You could specify AudioSource.CAMCORDER for your MediaRecorder, which should give you one of the internal microphones rather than the headset mic. The problem is that you might get the microphone at the back of the device (if the device has a mic there), which might not be what you want.

AudioSource.VOICE_RECOGNITION may map to the primary internal mic on some devices, but is not guaranteed to do so. There's also no guarantee about whether it will be tuned for near-field or far-field recording.