That boy 222 2022-08-18 10:44 采纳率: 0%
浏览 19

Android 百度AI语音无法识别

问题遇到的现象和发生背景

Android 百度AI语音识别不了,调用了sdk

问题相关代码,请勿粘贴截图

AppId AppKey SecretKey 这些都是 直接复制sdk文档上的,且 包名 与 appid 一致。

运行结果及报错内容

08-18 02:16:56.618 2227-2227/com.baidu.speech.recognizerdemo I/com.baidu.speech.recognizerdemo.MainActivity: 输入参数:{"appid":"请填入您的appId","key":"请填入您的apiKey","secret":"请填入您的secretKey","accept-audio-volume":false} ;time=1660789016618
08-18 02:16:56.627 2227-2227/com.baidu.speech.recognizerdemo I/com.baidu.speech.recognizerdemo.MainActivity: name: asr.ready ;params :{"pid":1537,"sn":"4b65ac24-1f77-4660-ac35-9746e8fd4aa8"} ;time=1660789016627
08-18 02:16:57.111 2227-2361/com.baidu.speech.recognizerdemo I/MicrophoneServer: audio mills is 0
08-18 02:16:57.119 2227-2227/com.baidu.speech.recognizerdemo E/AutoCheck: 【错误】【检查AppId AppKey SecretKey 】 java.io.FileNotFoundException:https://openapi.baidu.com/oauth/2.0/token?client_id=请填入您的apiKey&client_secret=请填入您的secretKey&grant_type=client_credentials
08-18 02:16:57.264 2227-2342/com.baidu.speech.recognizerdemo W/BDSHttpRequestMaker: Download connection stauts has already been closed. &bdb8142,
08-18 02:16:57.265 2227-2248/com.baidu.speech.recognizerdemo E/ASREngine: EVoiceRecognitionClientWorkStatusError errorDomain : 33 errorCode : -3004 desc : Server app name unknown.[(-3004)asr authentication operation failed] mLastRecognitionResult:
08-18 02:16:57.265 2227-2248/com.baidu.speech.recognizerdemo D/ASREngine: generateErrorResult errDomain = 33 errCode = -3004
08-18 02:16:57.269 2227-2227/com.baidu.speech.recognizerdemo I/com.baidu.speech.recognizerdemo.MainActivity: name: asr.finish ;params :{"origin_result":{"sn":"","error":4,"desc":"App name unknown[(-3004)asr authentication operation failed]","sub_error":4004},"error":4,"desc":"App name unknown[(-3004)asr authentication operation failed]","sub_error":4004} ;time=1660789017269
08-18 02:16:57.300 2227-2227/com.baidu.speech.recognizerdemo I/com.baidu.speech.recognizerdemo.MainActivity: name: asr.exit ;time=1660789017300
08-18 02:16:57.338 2227-2361/com.baidu.speech.recognizerdemo W/System.err: java.util.concurrent.ExecutionException: java.io.IOException: Broken pipe
08-18 02:16:57.338 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.util.concurrent.FutureTask.report(FutureTask.java:94)
08-18 02:16:57.338 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.util.concurrent.FutureTask.get(FutureTask.java:178)
08-18 02:16:57.339 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.audio.MicrophoneServer.run(Unknown Source)
08-18 02:16:57.339 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.lang.Thread.run(Thread.java:818)
08-18 02:16:57.339 2227-2361/com.baidu.speech.recognizerdemo W/System.err: Caused by: java.io.IOException: Broken pipe
08-18 02:16:57.339 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at android.net.LocalSocketImpl.writeba_native(Native Method)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at android.net.LocalSocketImpl.-wrap5(LocalSocketImpl.java)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at android.net.LocalSocketImpl$SocketOutputStream.write(LocalSocketImpl.java:135)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.audio.MicrophoneServer$2.call(Unknown Source)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at com.baidu.speech.audio.MicrophoneServer$2.call(Unknown Source)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo W/System.err: ... 1 more
08-18 02:16:57.340 2227-2361/com.baidu.speech.recognizerdemo I/[BDASR_LOG] MicrophoneServer: finally, mRemoteOutputStreams size = 0 firstStart = true

我的解答思路和尝试过的方法

按照作者博客上的方法测试的

  • 写回答

1条回答 默认 最新

    报告相同问题?

    相关推荐 更多相似问题

    问题事件

    • 创建了问题 8月18日

    悬赏问题

    • ¥15 关于C# 英文打字练习器程序设计
    • ¥15 synchronized
    • ¥15 想用switch完成这个操作,但试了很多遍都无法运行
    • ¥15 wfp应用层设计规则如何能传递到内核层
    • ¥15 关于机器学习创新点几个问题
    • ¥15 python程序编写
    • ¥15 Type-C扩展坞的RTL8153地址硬改
    • ¥15 uniapp websocket 发送 sub 监听后,代码自动发送了 unsub ,解除了监听
    • ¥15 nativefier封装electron的应用遇到alert弹窗后input栏获取不到焦点,confirm不弹出的问题。
    • ¥15 Simulink使用HDL coder生成verilog代码时遇到问题