I am trying to record voip call of what's-app and some how able to trigger recording at the same time when an VOIP call is ongoing .
Trying the Below code to record the VOIP Call
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION);
recorder.setOutputFormat(MediaRecorder.OutputFormat.AMR_NB);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(audiofile.getAbsolutePath());
try {
recorder.prepare();
} catch (IllegalStateException e)
{
e.printStackTrace();
}
recorder.start();
but for VOIP call whats app is also using AudioRecorder with the same Audio Source and whoever either my app Recording service or whatsapp able to get an instance of recorder will run perfectly and other app stucked due to Audio Resource Busy . Any suggestion how will i record the Voip Call
Related
I am trying to create an audio recorder app that records audio and should save audio only when users click on the save button. But the problem I am facing is that as soon as recording stops it saves automatically. And if I try to set setOutputFile to null then the app crashes.
Code
mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mediaRecorder.setOutputFile(AudioSavePathInDevice);
Does Anybody know how to save that audio recording manually?
I want to implement call recording in my one app, So I have used below questions for reference:
Android Recording Incoming and Outgoing Calls
How To Record Incoming Call in android programmatically?
I am using below code to record a call
recorder.reset();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
But I have also try to use different audio source and output format but it's not recording properly
its recording one-sided call sometimes, and when changing to voice_call and voice_communication its not recording calls at all
In some thread, I found that in some devices it's not working properly but I found some apps in play store which works quite good
https://play.google.com/store/apps/details?id=com.appstar.callrecorder
m new to android, was just trying to record the calls. After hanging up, recording should be saved but it's not there in storage. can somebody help me with it
public void startRecording() throws IOException {
ditchRecord();
File outFile=new File(OUTPUT_FILE);
if(outFile.exists()){
outFile.delete();
}
recorder= new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(OUTPUT_FILE);
recorder.prepare();
recorder.start();
}
private void ditchRecord() {
if(recorder!=null)
recorder.release();
}
Based on the documentation,
Capturing from VOICE_CALL source requires the CAPTURE_AUDIO_OUTPUT permission. This permission is reserved for use by system components and is not available to third-party applications.
Hence, it looks like what you're trying to do is not possible, unless your app is installed as a system app, which will only work on rooted devices.
quickblox api working fine for calling.I want to record the call so there is any method for recording?
You can use
MediaRecorder myAudioRecorder = new MediaRecorder();
when you receive call you can start recording and on call end you can stop recording.
for more information go to this link
I managed to record audio by sending intent with action MediaStore.Audio.Media.RECORD_SOUND_ACTION.
But is there a way to tell MediaStore application to automatically start recording without the need for user to press record button?
I don't see relevant parameters nor MediaStore.Audio.Media nor in MediaStore.
And same question for video...
You can directly use the MediaRecorder object to record. This way you can control when and how to start the voice recording.
recorder = new MediaRecorder();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();