I have seen several Android and iOS software projects that use the headphone jack to receive signal, instead of only outputting signal as is the usual purpose of the jack. For example:


I need to know how to do the same on a Lumia phone. Does anyone know of any code samples or documentation on how to capture an audio signal coming in to the headphone jack?

Note, I am not talking about the typical use of playing signal (music, sounds, etc.) out the headphone jack. I want to receive signals from the device connected to the headphone jack, which is the opposite direction of the usual signal flow for the jack. I have seen Android and iOS remote control apps that use the headphone jack in a bi-directional manner, and I want to do the same on a Windows 8 Phone. I need to be able to capture an audio signal coming in to the phone. I will then decode the pulses in the audio signal to extract the data I am looking for from that signal.

The fact that Square now has an app on Windows phone indicates that what I want to do is possible since their card reader attaches to the phone's headphone jack:


I just need to know the technique involved.

-- roschler