I am using MediaRecorder
for recording call in android. But I only want to record the caller's voice. Can this be done?
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
// mRecorder.setOutputFile("/sdcard/yousuck2.3gp");
if (audiofile == null) {
File sampleDir = Environment.getExternalStorageDirectory();
try {
audiofile = File.createTempFile("ibm", ".3gp", sampleDir);
} catch (IOException e) {
Log.e(TAG, "sdcard access error");
return;
}
}
Also what is the difference between VOICE_CALL
, VOICE_UPLINK
and VOICE_DOWNLINK
? I read the Android docs but could not understand.