How to read data from a 3.5mm headphone hack?

What's connected to the other end of the 3.5mm connector?