I am building an android app, having feature of capturing sound through microphone and playing it through headphone. For this, I have used \"AudioRecord\" and \"AudioTrack\"
Set your outputformat of the recorder as MediaRecorder.OutputFormat.DEFAULT. I have used this and the resulting audio file is an mp3.
outputformat
MediaRecorder.OutputFormat.DEFAULT