ML Kit ASR error: Error code:40,subError code:3005,errorMessage: Service unavailable

ML Kit ASR error: Error code:40,subError code:3005,errorMessage: Service unavailable

我一直在开发语音识别演示,运行 遇到了问题。谁能帮帮我?我调用了startRecognizing接口,收到了一个onError回调(错误11203,subError 3005,errorMessage:服务不可用),见截图:

我按照document,我的代码:

// 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)

您知道为什么会发生这种情况吗?请帮忙,谢谢!!

您需要将 "en-US" 更改为 "zh-CN"

或者注释掉".putExtra(SCENES, SCENES_SHOPPING)":