我怎样才能在Android中录制的语音和通话记录? [英] How can I record voice and record Call in Android?

查看:264
本文介绍了我怎样才能在Android中录制的语音和通话记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我,如果你知道如何录制声音,还打电话时同时记录呼叫者和卡莱的声音。如果有人知道,然后给我一个提示。

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.

推荐答案

是有可能只是做到这一点

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();

这篇关于我怎样才能在Android中录制的语音和通话记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆