37

如果您知道如何在android中记录呼出和呼入,请帮助我

4

8 回答 8

10

是的 可以这样做

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!");
}

停止你可以使用

callrecoder.stop();
于 2013-08-29T08:26:31.103 回答
8

看一下这个...

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

简短的回答是……买一个 Galaxy S,最好是韩国版。

于 2010-11-16T19:26:22.600 回答
6

据我所知,Android 上所有录制语音通话的应用程序都存在相同的问题:它们只能在某些手机上运行,​​而在其他手机上,您只能听到对话的一侧。其中一些应用程序也尝试通过从麦克风录制来解决此问题。

如果您在 Android 手机上拥有 root 权限,那么我相信有些应用程序运行得更好,因为它们可以访问较低级别的流,正如 Emmanuel 在他的回答中所指定的那样。

于 2010-12-27T11:32:01.807 回答
5

我不知道它是否可能,但就 API 而言

recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);

这一行在我的代码中编译得很好,其中记录器是 MediaRecorder 的一个对象,我曾经从事过这样的项目,但后来该项目被转储了,所以不确定它是否有效

于 2010-12-28T09:26:55.393 回答
4

您无法在 Android 上录制电话对话。流位于较低级别的操作系统中,在应用程序级别中不可访问。对不起。

于 2010-11-16T15:01:52.580 回答
2

取决于电话到电话,例如,您不能在 nexus 和摩托罗拉电话上录制通话,因为它们不允许在通话进行之前从麦克风录音。但是,在通话时使用麦克风进行的相同录音适用于大多数三星和 Galaxy 设备。

于 2012-12-02T11:55:58.790 回答
2

API 显然在那里,但制造商已禁用他们的无线电固件来执行此操作。

于 2011-01-12T15:55:33.153 回答
1

我害怕知道 android 没有原生的 api 来记录语音通话。正如 Emmanuel hase 所说,即使流在操作系统中也是抽象的,并且在应用层中是不可访问的。我认为这是Android 开发人员的严重错误。如果安全墙有一个小洞,它就不再安全了。因此,即使 droid 限制或试图限制,也存在其他可以具有此类功能的手机。即使是定制的机器人内核也可以具有这种功能。这只会让 droid 用户变得很差。

于 2010-12-27T10:48:37.600 回答