AudioSource.VOICE_CALL无法在Android 6.0版本

时间:2018-01-05 07:33:58

标签: android

中的运行时间exception
                recorder = new MediaRecorder();
                recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
                recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                recorder.setOutputFile(audiofile.getAbsolutePath());
  

java.lang.RuntimeException:接收广播Intent时出错{   act = android.intent.action.NEW_OUTGOING_CALL flg = 0x10000010(有   a.callrecoder.TService$a@e5c022中的附加内容}                                                                      在android.app.LoadedApk $ ReceiverDispatcher $ Args.run(LoadedApk.java:1138)                                                                      在android.os.Handler.handleCallback(Handler.java:751)                                                                      在android.os.Handler.dispatchMessage(Handler.java:95)                                                                      在android.os.Looper.loop(Looper.java:154)                                                                      在android.app.ActivityThread.main(ActivityThread.java:6184)                                                                      at java.lang.reflect.Method.invoke(Native Method)                                                                      在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:898)                                                                      在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:788)                                                                   引起:java.lang.RuntimeException:启动失败。                                                                      在android.media.MediaRecorder.start(Native方法)                                                                      at a.callrecoder.TService $ a.onReceive(Unknown Source)                                                                      在android.app.LoadedApk $ ReceiverDispatcher $ Args.run(LoadedApk.java:1128)                                                                      在android.os.Handler.handleCallback(Handler.java:751)                                                                      在android.os.Handler.dispatchMessage(Handler.java:95)                                                                      在android.os.Looper.loop(Looper.java:154)                                                                      在android.app.ActivityThread.main(ActivityThread.java:6184)                                                                      at java.lang.reflect.Method.invoke(Native Method)

1 个答案:

答案 0 :(得分:0)

IFS=':' for svc in "${svc_list[@]}" do echo $svc done 来源需要CAPTURE_AUDIO_OUTPUT权限,该权限仅授予系统应用,不授予第三方应用。