Hi,
Out of those three it' quite a hard choose. I'd go for Nexus 5, due to easiness to install Custom ROM, root, etc. Not only this, but this device is good looking and has a good screen. LG G2 is a nice phone and has, probably, the best screen among the three (not sure though, using N5 and G2 on a store and owning a S4 I can tell it), also has one of the thinnest bezels over there and is one of the thinnest phones.
For headphone quality it's obviously Sony, the best headphone I used was a Sony Noise Reduction owned by my cousin and the second best was the headphone that came with my Xperia Z1. If I were you I'd choose between Nexus 5 and Z1 actually... But that isn't the case now. Keeping in mind what you want to do, then I think S4 is the most suitable, while it's uglier than N5, is harder to customize and is not as thin or have a screen as good as G2, you have everything good with it, not great, but good, if you can understand me. I liked Galaxy S4 headphones, but mine broke in a shot time span.
All in all, any of them would suit you quite goodly. The best thing I'd recommend you doing is going to a nearby store and trying each of them, so check which you like better
.
~Lord
PS.: If you get S4, make sure you get the Snapdragon variant (GT-I9505), otherwise it'll be harder to install custom ROMs.