While audio jacks often have switches that can be used for plug detection, most codecs now implement jack sensing that measures the impedance and other characteristics of the plugged in device and make that information available to the processor they are connected to.
This is also very helpful in preventing an audio amplifier from trying to drive speakers outside its impedance range and damaging the amp or the speakers.
I am experienced in multi-track magnetic card reading but I am not familiar with the specific hardware you are asking about, and many other readers also will not be. If you provide more information about the specific system and hardware a better answer can be given.
It sounds as though you have a multi track magnetic card reader intended specifically for use with an iPhone, using the iPhone's audio input jack as a data input port. Assuming this is so -
It is likely that the reader contains multitrack reading electronics which decodes all information from all tracks and then uses it to produce a modulated "modem" tone source. The "magic" would be internal to the reader and not substantially different from most card readers. Most usually-used card information is contained on one track. Some applications can use that alone. Some need two tracks and some all three. For completeness a reader would ideally read all three tracks and output the data for use as required.
It is conceivable that a reader could output information from a track in the form of an audio tone with modulation corresponding in some way to data transitions from the read head. While this is possible, the cost of including a microcontroller in a reader is minimal (perhaps 20 cents or even less in large volume) and the flexibility provided is so great that it is nearly certain that an internal microcontroller is used. Using a controllerless design it would be relatively easy to output tones corresponding to one track and possible but increasingly hard to simultaneously generate and combine signals from 2 or 3 tracks. Again, the overhead of doing this would be large enough that it seems a most unlikely approach.
The magnetic tracks on a card contain data in a format that contains both clocking and data combined. Reading is relatively swipe-speed independent as the clock is generated by the swiping motion. Depending on the cleverness of he software you may be able to "fool" the software by changing speed substantially across the passage of a swipe.
* UPDATE*
My above comments about how it might be done were correct. BUT how it is actually done can be seen via the link below. This information courtesy of M.Adam Davis.
The device takes the simplest possible approach - only one track is read and the sole electronics is a resistor connected from read head to audio jack!.
This is what it sounds like:
Adam says: "Don't let anyone listen to your own credit cards, of course - use other people's cards for that demonstration.
Here are my pictures of the unit I disassembled. It's the most recent
version (Spring 2011) but I don't anticipate it's much different than
the earlier version I have been using.
One read head, one resistor, and a four pole audio jack with the read
head going to the microphone input and ground. "
Best Answer
Each ear hears the sum of the sound pressure oscillations on the eardrum. There is only one signal felt by the eardrum yet our brains can clearly identify the multiple sources in a musical piece or a voice over background noise.
Analog electrical sound signals are exactly that - an analog. The voltage rises and falls as an analogy of the sound pressure on the microphone, etc.
Figure 1. Three individual sinewaves and their sum. If you hit three different frequency tuning forks the sines would represent the audio waveform from each and the yellow curve would represent the sum of those reaching the ear. In their electrical form the process is the same.
Yes it does.
The sound card sums the signals it receives. For audio at CD quality the soundcard will do a digital to analog conversion at > 40 kHz so the three data streams would have to arrive at that frequency too. Each sample from each source would be buffered (as they are coming in serially in your example), summed and converted to an analog output sample.
Generally it would be done digitally but there could be an analog mixer for special applicatons.
For a simple sum of three signals it would: Buffer all the inputs for one sample. Sum them. Output the analog value of the sum. It can get way more complicated than that however. Your Windows audio mixer, for example, allows you to adjust the volume of each sound source so there would be some multiplication taking place on each signal before the summation. Tone controls would add another layer of increasing complexity and any time dependent effects such as reverb, echo, chorus, pitch-change, etc., would require much more computation on each signal before conversion to analog.
Figure 2. Sound card block diagram by Alexander Pimpas.
The random web image above shows several features. I can't vouch for its accuracy or age.