Is the capacitor simply to avoid sending DC back into the audio device through the headphone jack?
I'm also thinking that you would have to choose the right size capacitor and resistor so it doesn't form a highpass filter that would cut out any low frequencies that you might still want.
Yes the capacitor prevents dc from flowing into the headphone jack. Basically what this circuit does is
1) Voltage divider creates a dc bias point
2) AC flowing via the capacitor disturbs this bias point in relation to the signal swing.
Of course you'll have to size the components properly, otherwise you'll get a lot of attenuation in the higher frequency. Also, if the capacitor is too large, it will take a long time before it charges to the equilibrium voltage.
There's one more solution- the clamper circuit, however the bias point will depend on the signal swing.