Using earphone for audio output, is it possible?

Hi

In brief: I am creating a voice call app and I want to use earphone to receive the audio, not the speaker.

How can I make this work?

Thanks in advance