Android 安卓可以';不要用清晰的声音记录来电
我只能用这个密码录下我的声音,不能逆着转弯 我用了Android 安卓可以';不要用清晰的声音记录来电,android,Android,我只能用这个密码录下我的声音,不能逆着转弯 我用了MediaRecorder.AudioSource.VOICE\u CALL而不是MediaRecorder.AudioSource.MIC 但我还是只能听到自己的声音 这是我的密码 public class RecorderService extends IntentService { private Context mContext; private MediaRecorder recorder; static fi
MediaRecorder.AudioSource.VOICE\u CALL
而不是MediaRecorder.AudioSource.MIC
但我还是只能听到自己的声音
这是我的密码
public class RecorderService extends IntentService {
private Context mContext;
private MediaRecorder recorder;
static final String TAGS = "RecorderService";
private String phoneNumber;
public RecorderService() {
super("RecorderService");
}
@Override
protected void onHandleIntent(Intent intent) {
}
@Override
public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
Log.e(TAGS, "Started!");
mContext = getApplicationContext();
phoneNumber = intent.getStringExtra("number");
Log.e(TAGS, "Calling Number : " + phoneNumber);
recorder = new MediaRecorder();
startRecording();
return START_NOT_STICKY;
}
@Override
public void onDestroy() {
super.onDestroy();
Log.e(TAGS, "Stopped!");
stopRecording();
}
private void startRecording() {
Log.e(TAGS, "Recording Started");
File file = new File(Environment.getExternalStorageDirectory()
+ File.separator
+ "My Records"
+ File.separator);
recorder.reset();
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recorder.setOutputFile(file.getAbsolutePath() + "record.mp3");
try {
recorder.prepare();
} catch (IOException e) {
e.printStackTrace();
}
recorder.start();
}
private void stopRecording() {
Log.e(TAGS, "Recording Stopped");
if (recorder != null) {
recorder.stop();
recorder.reset();
recorder.release();
recorder = null;
}
}
}
任何建议 你不能。除非您是一个系统应用程序(您需要安装自己的自定义操作系统或成为root用户才能获得)。VOICE_CALL需要CAPTURE_AUDIO_OUTPUT权限,这是一个系统权限-普通应用程序无法使用它
Play store上的其他应用程序是如何做到这一点的?他们使用麦克风,希望呼叫的输出声音足够大,可以拾取。嗨,Dinesh,欢迎来到Stack Overflow!请编辑您的帖子,使其更具吸引力。这将使别人更容易回答你的问题。你的问题与你的问题无关