(Android) Get audio signal from the audio line-in instead of phone microphone

15,450

You made some assumptions which might not be correct. Regular android phones have no Line Ins.They are not designed to be professional audio systems.

When you plug your headset, android automatically recognises your external MIC and you dont need to set it in your code.Just leave it in DEFAULT.

The problem is, you will need an special and compatible connector for your MIC. As you might notice the headset connector for your mobile is different from an streo Jack.So you will need an adapter or solder your own compatible Jack.If you connect your MIC with two parts, android will assume that its a headphone and not a MIC!

Here is the link to article: How do I use an external microphone with my Galaxy Nexus? enter image description here

Share:
15,450
Phalanx
Author by

Phalanx

Updated on June 04, 2022

Comments

  • Phalanx
    Phalanx almost 2 years

    I'm working on an Android program whose purpose is to record a sound signal and then to analyse it. To record this sound signal, I am using a special microphone I want to plug to my Android device directly via the audio line-in, so I won't use the mobile phone microphone.

    Here is what I found on Android website :

    " Defines the audio source. These constants are used with setAudioSource(int). Summary Constants int CAMCORDER Microphone audio source with same orientation as camera if available, the main device microphone otherwise int DEFAULT Default audio source int MIC Microphone audio source int VOICE_CALL Voice call uplink + downlink audio source int VOICE_COMMUNICATION Microphone audio source tuned for voice communications such as VoIP. int VOICE_DOWNLINK Voice call downlink (Rx) audio source int VOICE_RECOGNITION Microphone audio source tuned for voice recognition if available, behaves like DEFAULT otherwise. int VOICE_UPLINK Voice call uplink (Tx) audio source "

    It seems that there is no way to define the line in as an audio source. I have tried to plug my own microphone to my mobile and then to record the sound, hoping that it will recognize my own microphone (as a handfree kit) but it keeps recording on the mobile phone microphone.

    Does anyone know what to set as an audio source so I can use the line-in ?

    Many thanks in advance !