If you choose, for example, DEFAULT or MIC from MediaRecorder.AudioSource as the input signal, then instead of the internal microphone, the TRRS plug connected to your phone will be used.
But you have two questions:
1) Number of channels
The TRRS plug has two lines for the left and right channels of the headphones, but only one line for an external microphone (see, for example, this description of the plug ). Thus, you can make monaural recordings (the only exception for the smartphone at the moment: the Sony Z2 has a new TRRRS connector). You can build the adapter yourself (see, for example, the pictures here ).
2) Level
You cannot connect a line output, for example. CD player directly to the input. You should use, for example. resistive voltage divider to reduce the output level, to avoid overload.
3) Signal processing
Typically, firmware such as automatic gain control (AGC), and / or equalization, noise reduction, echo cancellation, uses firmware that is specific to the manufacturer. You cannot turn it off, so you will not get a perfect copy of your input signal.
source share