1. 程式人生 > >初學安卓,使用AudioRecord

初學安卓,使用AudioRecord

在小米和華為兩臺手機上沒有問題

在Newton2 Plus開發板上不行 (Android5.1)

錯誤資訊:

08-21 20:06:02.807 1958-2072/com.test.testh264sender E/OMXMaster: A component of name 'OMX.LUMEVideoDecoder' already exists, ignoring this one.
    A component of name 'OMX.LUMEVideoDecoder' already exists, ignoring this one.
    A component of name 'OMX.LUMEVideoDecoder' already exists, ignoring this one.

08-21 20:06:02.889 1958-2061/com.test.testh264sender E/AudioRecord: Could not get audio input for record source 7, sample rate 44100, format 0x1, channel mask 0xc, session 11, flags 0

08-21 20:06:02.910 1958-2061/com.test.testh264sender E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -22.

08-21 20:06:02.910 1958-2061/com.test.testh264sender E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.

08-21 20:06:02.911 1958-2061/com.test.testh264sender W/System.err: java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord.

08-21 20:06:02.919 1958-2061/com.test.testh264sender W/System.err:     at android.media.AudioRecord.startRecording(AudioRecord.java:609)
        at com.laifeng.sopcastsdk.audio.AudioUtils.checkMicSupport(AudioUtils.java:26)
        at com.laifeng.sopcastsdk.ui.CameraLivingView.check(CameraLivingView.java:161)
        at com.laifeng.sopcastsdk.ui.CameraLivingView.access$000(CameraLivingView.java:42)

08-21 20:06:02.920 1958-2061/com.test.testh264sender W/System.err:     at com.laifeng.sopcastsdk.ui.CameraLivingView$1.process(CameraLivingView.java:187)

        at com.laifeng.sopcastsdk.utils.SopCastUtils$1.run(SopCastUtils.java:27)
        at java.lang.Thread.run(Thread.java:818)

08-21 20:06:02.920 1958-2061/com.test.testh264sender W/SopCast: Can not record the audio

08-21 20:06:02.929 1958-1958/com.test.testh264sender E/LaifengLivingActivity: living start error ... error_code6

參考:

https://bbs.csdn.net/topics/390889880

https://blog.csdn.net/singleton1900/article/details/39480187

https://blog.csdn.net/qq_36982160/article/details/79383046

https://blog.csdn.net/baidu_33546245/article/details/80503091