Getting earphone out from music player
I am not sure what you are really asking for. But let me try to answer it. What I understand is, you want an audio output which you can listen to as well as give it to Arduino at the same time.
For taking out the Audio from, say, your mobile, use an aux cable. Now this cable has generally 4 wires. One for ground, one for mic, one for left ear sound, and one for right ear's sound.


Image source: circuitbasics.com

One end of this cable goes inside your mobile phone and the other to a audio socket. Now the audio socket, depending on its type, may have 4 pins. These 4 pins are connected to the corresponding 4 wires in aux cable. Some of them do not have the mic pin out. But you yourself have to find out which pins are for what purpose. 

Image source: ebay.com

So all you have to do is take ground pin and any of one (right or left) of the audio pin. Give them to your Arduino. Use the same two pins(Gnd and audio) to connect to an another audio socket. Your earphones will be inserted in this second audio socket. So you can listen to the sound and give it to the Arduino at the same time. You can use an amplifier if you wish to listen to music.