我使用的服务是:Android 识别服务
调用的接口是:
intent.setAction("com.baidu.action.RECOGNIZE_SPEECH");startActivityForResult(intent, REQUEST_UI);
参数设置情况:
无
开发平台和机型:android studio ; 华为荣耀P6 plus
SDK版本号:23
代码或日志截图(上传截图能帮助您更快解决问题):
11-25 00:44:10.460 30611-30611/com.baidu.speech.recognizerdemo I/VoiceRecognitionService: onCreate(), hashcode=63570597
11-25 00:44:10.461 30611-30611/com.baidu.speech.recognizerdemo I/VoiceRecognitionService: internal=false
11-25 00:44:10.568 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: setDataSource(54, 262548, 4587)
11-25 00:44:10.585 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake true uid: 10473, pid: 30611
11-25 00:44:10.905 30611-32416/com.baidu.speech.recognizerdemo E/MediaPlayer: internal/external state mismatch corrected,mAudioTearDown = 0
11-25 00:44:10.964 30611-32416/com.baidu.speech.recognizerdemo I/AudioRecordPermission: remindWithResult:false
11-25 00:44:10.964 30611-32416/com.baidu.speech.recognizerdemo I/HwAudioRecordImpl: checkRecordActive
11-25 00:44:10.969 30611-32416/com.baidu.speech.recognizerdemo I/HwAudioRecordImpl: sendStateChangedIntent, state=3
11-25 00:44:11.011 30611-32416/com.baidu.speech.recognizerdemo I/MicrophoneInputStream: new instance(), sUsingCount=1, sInnerSourceInputStream=com.baidu.speech.MicrophoneInputStream$InnerSourceInputStream@95a3288
11-25 00:44:11.014 30611-32416/com.baidu.speech.recognizerdemo I/jni_easr: #31421 easrNativeJni calling AudioSegFree():
11-25 00:44:11.014 30611-32416/com.baidu.speech.recognizerdemo E/art: No implementation found for int com.baidu.speech.easr.easrNativeJni.AudioSegFree() (tried Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree and Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree__)
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: java.lang.reflect.UndeclaredThrowableException
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at $Proxy3.AudioSegFree(Unknown Source)
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerVadModule.send(EventManagerVadModule.java:138)
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerVadModule.send(EventManagerVadModule.java:97)
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerMessagePool$1.run(EventManagerMessagePool.java:46)
11-25 00:44:11.015 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Handler.handleCallback(Handler.java:743)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Looper.loop(Looper.java:150)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: Caused by: java.lang.reflect.InvocationTargetException
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at java.lang.reflect.Method.invoke(Native Method)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.easr.EasrFactory$2.invoke(EasrFactory.java:188)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at java.lang.reflect.Proxy.invoke(Proxy.java:393)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: ... 8 more
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.speech.easr.easrNativeJni.AudioSegFree() (tried Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree and Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree__)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.easr.easrNativeJni.AudioSegFree(Native Method)
11-25 00:44:11.016 30611-32416/com.baidu.speech.recognizerdemo W/System.err: ... 11 more
11-25 00:44:11.021 30611-32416/com.baidu.speech.recognizerdemo I/AuthEasrHelper: easr auth: licenseUri=, appid=8866441
11-25 00:44:11.022 30611-32416/com.baidu.speech.recognizerdemo I/AuthEasrHelper: licensePath:
11-25 00:44:11.027 30611-32416/com.baidu.speech.recognizerdemo I/jni_easr: #31421 easrNativeJni calling GetLicense(com.baidu.speech.EventContext@3fd2421, "8866441", "7B3A70346192FE1576EA51366B014119|140134120106768", "eyJ3aXNlX2N1aWQiOiI3QjNBNzAzNDYxOTJGRTE1NzZFQTUxMzY2QjAxNDExOXwxNDAxMzQxMjAx
MDY3NjgiLCJzZGtfdmVyc2lvbiI6IjIuMS4yMC4yMDE2MDYyM19lM2U2M2NlX2JldGEiLCJhcHBf
bmFtZSI6ImNvbS5iYWlkdS5zcGVlY2gucmVjb2duaXplcmRlbW8iLCJwbGF0Zm9ybSI6IkFuZHJv
aWQmUEUtVEwxMCY2LjAmMjMmMyIsIm9zIjoiQW5kcm9pZCIsIm5ldF90eXBlIjozLCJzY3JlZW4i
OiIxMDgwKjE4MTIiLCJhcHBfc2lnbmF0dXJlIjoiMDJlMDVjODU3NGM1YWI3YWJjZjVhZmFlMzM5
OTc0YWQifQ==
", "/data/user/0/com.baidu.speech.recognizerdemo/files/bds-easr-license.lic"):
11-25 00:44:11.028 30611-32416/com.baidu.speech.recognizerdemo E/art: No implementation found for int com.baidu.speech.easr.easrNativeJni.GetLicense(android.content.Context, java.lang.String, java.lang.String, java.lang.String, java.lang.String) (tried Java_com_baidu_speech_easr_easrNativeJni_GetLicense and Java_com_baidu_speech_easr_easrNativeJni_GetLicense__Landroid_content_Context_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2Ljava_lang_String_2)
11-25 00:44:11.029 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake false uid: 10473, pid: 30611
11-25 00:44:11.033 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: setDataSource(58, 256440, 6040)
11-25 00:44:11.054 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake true uid: 10473, pid: 30611
11-25 00:44:11.062 30611-32416/com.baidu.speech.recognizerdemo I/jni_easr: #31421 easrNativeJni calling AudioSegFree():
11-25 00:44:11.068 30611-32416/com.baidu.speech.recognizerdemo E/art: No implementation found for int com.baidu.speech.easr.easrNativeJni.AudioSegFree() (tried Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree and Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree__)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: java.lang.reflect.UndeclaredThrowableException
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at $Proxy3.AudioSegFree(Unknown Source)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerVadModule.send(EventManagerVadModule.java:168)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerVadModule.send(EventManagerVadModule.java:97)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.EventManagerMessagePool$1.run(EventManagerMessagePool.java:46)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Handler.handleCallback(Handler.java:743)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
11-25 00:44:11.069 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.Looper.loop(Looper.java:150)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at android.os.HandlerThread.run(HandlerThread.java:61)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: Caused by: java.lang.reflect.InvocationTargetException
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at java.lang.reflect.Method.invoke(Native Method)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.easr.EasrFactory$2.invoke(EasrFactory.java:188)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at java.lang.reflect.Proxy.invoke(Proxy.java:393)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: ... 8 more
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: Caused by: java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.speech.easr.easrNativeJni.AudioSegFree() (tried Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree and Java_com_baidu_speech_easr_easrNativeJni_AudioSegFree__)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.easr.easrNativeJni.AudioSegFree(Native Method)
11-25 00:44:11.070 30611-32416/com.baidu.speech.recognizerdemo W/System.err: ... 11 more
11-25 00:44:11.076 30611-32416/com.baidu.speech.recognizerdemo I/jni_easr: #31421 easrNativeJni calling KWSFree():
11-25 00:44:11.077 30611-32416/com.baidu.speech.recognizerdemo E/art: No implementation found for int com.baidu.speech.easr.easrNativeJni.KWSFree() (tried Java_com_baidu_speech_easr_easrNativeJni_KWSFree and Java_com_baidu_speech_easr_easrNativeJni_KWSFree__)
11-25 00:44:11.078 30611-32416/com.baidu.speech.recognizerdemo I/jni_easr: #31421 easrNativeJni calling KWSFree():
11-25 00:44:11.078 30611-32416/com.baidu.speech.recognizerdemo E/art: No implementation found for int com.baidu.speech.easr.easrNativeJni.KWSFree() (tried Java_com_baidu_speech_easr_easrNativeJni_KWSFree and Java_com_baidu_speech_easr_easrNativeJni_KWSFree__)
11-25 00:44:11.120 30611-18992/com.baidu.speech.recognizerdemo I/System: core_booster, getBoosterConfig = false
11-25 00:44:11.130 30611-18975/com.baidu.speech.recognizerdemo I/HwAudioRecordImpl: sendStateChangedIntent, state=1
11-25 00:44:11.133 30611-18975/com.baidu.speech.recognizerdemo I/MicrophoneInputStream: close(), sUsingCount=0, sInnerSourceInputStream=null
11-25 00:44:11.435 30611-32416/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake false uid: 10473, pid: 30611
11-25 00:44:11.545 30611-18992/com.baidu.speech.recognizerdemo I/Parser: ===== parse(...) =====
{"result":{"err_no":-3005, "error":"speech quality problem", "sn":"abd6e1be-39c2-4a95-8ebd-2ed034156f8f", "idx":-1}}
11-25 00:44:11.545 30611-18992/com.baidu.speech.recognizerdemo I/Parser: parse with res_type=0
11-25 00:44:12.030 30611-30611/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake false uid: 10473, pid: 30611
11-25 00:44:12.437 30611-30611/com.baidu.speech.recognizerdemo I/MediaPlayer: [HSM] stayAwake false uid: 10473, pid: 30611
复现步骤、现象及其他描述:
点击开始即可,百发百中。三天前,我用同样的代码,是可以正常识别语音的。
我们sdk种没有使用org.xutils:xutils:3.3.4这个库。
水寒319:
-3005错误是由于语音质量低导致。
回复水寒319:看到这里有显示的log信息: {"result":{"err_no":-3005, "error":"speech quality problem", "sn":"abd6e1be-39c2-4a95-8ebd-2ed034156f8f", "idx":-1}}
最后我从头开始添加代码,是在添加
compile 'org.xutils:xutils:3.3.4'之后,出现了so找不到。具体原因还是没找到,我避免使用这个org.xutils:xutils:3.3.4
-3005错误是由于语音质量低导致。