android - ML Kit ASR 错误:错误代码:40,子错误代码:3005,错误消息:服务不可用
问题描述
我一直在开发语音识别演示并遇到了问题。有人可以帮我吗?我调用startRecognizing
了接口并收到了一个 onError 回调(错误 11203,子错误 3005,错误消息:服务不可用),看截图:
我按照文档,我的代码:
// Create an Intent to set parameters.
val mSpeechRecognizerIntent = Intent(MLAsrConstants.ACTION_HMS_ASR_SPEECH)
// Use Intent for recognition parameter settings.
mSpeechRecognizerIntent
// Set the language that can be recognized to English. If this parameter is not set, English is recognized by default. Example: "zh-CN": Chinese; "en-US": English; "fr-FR": French; "es-ES": Spanish; "de-DE": German; "it-IT": Italian; "ar": Arabic; "th_TH": Thai; "ms_MY": Malay; "fil_PH": Filipino.
.putExtra(MLAsrConstants.LANGUAGE, "en-US") // Set to return the recognition result along with the speech. If you ignore the setting, this mode is used by default. Options are as follows:
// MLAsrConstants.FEATURE_WORDFLUX: Recognizes and returns texts through onRecognizingResults.
// MLAsrConstants.FEATURE_ALLINONE: After the recognition is complete, texts are returned through onResults.
.putExtra(MLAsrConstants.FEATURE, MLAsrConstants.FEATURE_WORDFLUX) // Set the application scenario. MLAsrConstants.SCENES_SHOPPING indicates shopping, which is supported only for Chinese. Under this scenario, recognition for the name of Huawei products has been optimized.
.putExtra(MLAsrConstants.SCENES, MLAsrConstants.SCENES_SHOPPING)
// Start speech recognition.
mSpeechRecognizer.startRecognizing(mSpeechRecognizerIntent)
你知道为什么会发生这种情况吗?请帮忙,谢谢!!
解决方案
推荐阅读
- web-scraping - 抓取谷歌搜索结果并获取谷歌用来定义它的类别
- c++ - 为什么 std::variant 与比较类不在同一命名空间时找不到 operator<()
- swift - 在 RealityKit 中锚定多个场景
- ios - 如何将滑块值转换为 CMTime?
- php - 提交后的PHP表单问题
- android - 在真机中安装flutter应用程序使ADB退出代码1
- angular - 哨兵附加数据
- highcharts - Highcharts导出自定义轴标签和字体大小:迁移后没有效果
- .net - 升级 .NET 框架 4.8 后(更新 KB4486105)服务总线网关卡在启动模式
- c# - Serilog 中间件无法在错误处理中正常工作