How do media buttons on a plain wired headset work?
Each switch bridges the high-impedance microphone with a low resistance, allowing internal circuitry to sense the buttons. Here's a helpful image:
The MIC+ line has a bias voltage (to supply the mic), and by adding some additional circuitry to the mic preamp, it's easy to differentiate those resistor values.
This is the most common scheme for "on-headphone" controls. Additionally, it's very easy to implement in the headphones, allowing for cheap headphones and requires only a little bit more circuitry in the phone.
There are two basic types.
- Use a variable resistance between mic and Ground to signal different actions. The simplest being shorting mic to ground for Answer/Hangup/Take Picture. Ex: Android's Wired Audio Headset Specification v1.1:
- In or Out of band signaling. These use a microcontroller to insert a coded signal on the mic. Apple started this with one of their (now older) iPod Shuffle, and I believe thats what the current iPhones and MacBooks use.