media recorder getactivemicrophones()在真实设备中失败

btxsgosb  于 2021-06-27  发布在  Java
关注(0)|答案(0)|浏览(440)

我正在尝试为webrtc会议设置媒体设备,当我在android仿真器上进行测试时,它运行良好,但当我使用getactivemicrophones()方法运行真实手机时,它会崩溃,日志如下:

D/AppRTCAudioManager: --- updateAudioDeviceState: wired headset=true, BT state=HEADSET_UNAVAILABLE
D/AppRTCAudioManager: Device status: available=[], selected=NONE, user selected=NONE
    setAudioDeviceInternal(device=WIRED_HEADSET)
D/AppRTCAudioManager: New device status: available=[WIRED_HEADSET], selected=WIRED_HEADSET
D/ConferenceManager: onAudioManagerDevicesChanged: [WIRED_HEADSET], selected: WIRED_HEADSET
E/MediaRecorderJNI: MediaRecorder::getActiveMicrophones error -19
E/MediaRecorder: getActiveMicrophones failed:-5
I/MediaRecorder: getActiveMicrophones failed, fallback on routed device info
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.talentumtraining, PID: 18457
    java.lang.RuntimeException: getRoutedDeviceId failed.
        at android.media.MediaRecorder.native_getRoutedDeviceId(Native Method)
        at android.media.MediaRecorder.getRoutedDevice(MediaRecorder.java:1354)
        at android.media.MediaRecorder.getActiveMicrophones(MediaRecorder.java:1452)
        at com.example.talentumtraining.fragment.FragmentClinicConfigurations$SoundMeter.getDevices(FragmentClinicConfigurations.java:522)
        at com.example.talentumtraining.fragment.FragmentClinicConfigurations.onAudioManagerDevicesChanged(FragmentClinicConfigurations.java:405)
        at com.example.talentumtraining.fragment.FragmentClinicConfigurations.access$000(FragmentClinicConfigurations.java:59)
        at com.example.talentumtraining.fragment.FragmentClinicConfigurations$1.onAudioDeviceChanged(FragmentClinicConfigurations.java:228)
        at io.antmedia.webrtcandroidframework.apprtc.CustomAppRTCAudioManager.updateAudioDeviceState(CustomAppRTCAudioManager.java:581)
        at io.antmedia.webrtcandroidframework.apprtc.CustomAppRTCAudioManager.start(CustomAppRTCAudioManager.java:278)
        at com.example.talentumtraining.fragment.FragmentClinicConfigurations.onStart(FragmentClinicConfigurations.java:224)
        at androidx.fragment.app.Fragment.performStart(Fragment.java:2730)
        at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:365)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1194)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1356)
        at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1434)
        at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1497)
        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
        at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2169)
        at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1992)
        at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1947)
        at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1849)
        at androidx.fragment.app.FragmentManager$4.run(FragmentManager.java:413)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:192)
        at android.app.ActivityThread.main(ActivityThread.java:7049)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:913)

我不明白为什么会失败。你知道吗?提前谢谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题