问题
Please help me if you know how to record voice, and also to record the voice of both caller and calle during a phone call. If anybody knows then give me a hint.
回答1:
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();
回答2:
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.
回答3:
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.
回答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.
回答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
回答6:
The API is apparently there, but makers have disabled their radio firmware from being able to do this.
回答7:
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.
回答8:
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.
来源:https://stackoverflow.com/questions/4194342/how-can-i-record-voice-and-record-call-in-android