VOIP通话录音 [英] VOIP Call Recording
问题描述
我正在开发一个在 android 中录制 VOIP 通话的项目,我没有找到任何解决方案,有很多应用程序支持手机上的 VOIP 录音.我找不到任何教程和帮助.Cube Call Recorder 是其中一款应用这个功能,但我不知道怎么做.我通过使用 android MediaRecorder 开始录音进行了测试,然后启动了 whatsapp 呼叫,因此其他人无法听到我的声音.通话后,我检查了录音中只保存了我的声音.
I am working on a project to record VOIP calls in android, I didn't found any solution for that, there are lot of apps which support VOIP recordings on phones. I am unable to find any tutorial and help. Cube Call Recorder is one of the app which is giving this feature but I can't figure out how to do it. I was tested it by starting recording by using android MediaRecorder then initiated whatsapp call, so other person was unable to listen my voice. after call, I checked only my voice were saved in the recording.
作为一项研究,我对一些 apk 进行了逆向工程,我发现它们在 apk 中使用了辅助功能权限.
As a research I reverse engineered some apks, I found they are using Accessibility permissions in the apk.
<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />
我不知道我需要了解哪些事情,我怎样才能知道 VOIP 呼叫就像广播接收器一样来来去去.
I don't know what things I need to understand how can I get to know that to VOIP call is coming and going just like a BroadcastReceiver.
然后,我将了解如何记录通话.
Then, I will understand how can I record the calls.
推荐答案
我已经找到了答案
首先授予可访问权限并拥有这个类
First grant accessiblity permission and have this class
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.Intent;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class AccessAudio extends AccessibilityService {
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
Log.d("","gf");
}
@Override
protected void onServiceConnected() {
super.onServiceConnected();
AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
accessibilityServiceInfo.flags = 1;
accessibilityServiceInfo.eventTypes = -1;
accessibilityServiceInfo.feedbackType = 16;
setServiceInfo(accessibilityServiceInfo);
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return super.onStartCommand(intent, flags, startId);
}
@Override
public void onInterrupt() {
}
}
之后就可以使用了
mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_RECOGNITION);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mediaRecorder.setOutputFile(AudioSavePathInDevice.getPath());
mediaRecorder.prepare();
mediaRecorder.start();
这篇关于VOIP通话录音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!