How can I record voice and record Call in Android? [closed]
Asked Answered
H

8

37

Please help me if you know how can record outgoing and incoming call in android

Healthful answered 16/11, 2010 at 12:56 Comment(0)
F
10

Yes It is possible just do this

final MediaRecorder callrecorder = new MediaRecorder();
callrecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
callrecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
callrecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

callrecorder.setOutputFile(filepath);

try {
    callrecorder.prepare();
} catch (IllegalStateException e) {
    System.out.println("An IllegalStateException has occured in prepare!");
    // TODO Auto-generated catch block
    e.printStackTrace();
} catch (IOException e) {

    //throwing I/O Exception
    System.out.println("An IOException has occured in prepare!");
    // TODO Auto-generated catch block
    e.printStackTrace();
}

try {
    callrecorder.start();
} catch(IllegalStateException e) {
    e.printStackTrace();
    //Here it is thorowing illegal State exception
    System.out.println("An IllegalStateException has occured in start!");
}

for stopping you can use

callrecoder.stop();
Fassold answered 29/8, 2013 at 8:26 Comment(3)
I am getting "setAudioSource failed" exception on 2 devices: Galaxy S3 and Xperia Arc S.Phthisic
upvoted for MediaRecorder.AudioSource.VOICE_CALL instead of MediaRecorder.AudioSource.VOICE_COMMUNICATIONPinter
i am getting this error MediaRecorder: start failed: -2147483648Alfonsoalfonzo
C
8

Check this out...

http://androidforums.com/android-lounge/181663-android-phone-call-recording-function.html

The short answer is... Get a Galaxy S, preferably the South Korean version.

Check answered 16/11, 2010 at 19:26 Comment(0)
L
6

As far as I know, all the applications that record voice calls on Android have the same problem: they only work on some phones, while on other phones you can only hear one side of the conversation. Some of these apps try to solve this problem by recording from the microphone as well.

If you have root permissions on your Android phone, then I believe there are apps that work better because they have access to the lower level streams, as Emmanuel specified in his answer.

Lemmon answered 27/12, 2010 at 11:32 Comment(1)
What do the apps do with root exactly? How do they overcome this?Boony
A
5

I dont know if its possible but as far as API goes

recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);

this line compiles well in my code where recorder is an Object of MediaRecorder and I was once working on such project but later the project was dumped so not sure if it works or not

Aten answered 28/12, 2010 at 9:26 Comment(0)
C
4

You can't record a phone conversation on Android. The streams are in the lower level operating system and are not accessible in the application level. Sorry.

Concentre answered 16/11, 2010 at 15:1 Comment(2)
How does apps like Automatic Call Recorder and others work? They work even without a root.Continuous
How they do it?Compile
H
2

The API is apparently there, but makers have disabled their radio firmware from being able to do this.

Hagiography answered 12/1, 2011 at 15:55 Comment(0)
S
2

Depends on phone to phone e.g. You cannot record a call on nexus and motorola phones as they do not allow recording from mic till the call is on going. But the same recording from mic while on call works on most samsung and galaxy devices.

Sapindaceous answered 2/12, 2012 at 11:55 Comment(0)
K
1

I am afraid of knowing android doesn't have a native api to record voice calls. even the streams are abstracted in Operating System and inaccessible in application layer as Emmanuel hase stated. I consider it as a Serious mistake of Android Devs. if a security Wall have one tiny Hole its not secure any more. So even if droid restricts or tries to restricts there exists other phones where one can have such kind of functionality. even a custom droid kernel can have such kind of functionality. This only makes droid Users poor nothing else.

Kujawa answered 27/12, 2010 at 10:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.