SpeechRecognizer:未选择语音识别服务 [英] SpeechRecognizer: no selected voice recognition service
本文介绍了SpeechRecognizer:未选择语音识别服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我启动RecogniseListener目的的方式:
This is how i start my RecogniseListener intent:
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra("android.speech.extra.DICTATION_MODE", true);
intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,this.getPackageName());
intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true);
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,1);
sr.startListening(intent);
但是,我的行为很奇怪.它可以在某些手机上使用(在这种情况下为三星银河S5),但在联想K50-T5上却出现以下错误:
However, i get a strange behavior. It works on some phones (Samsung galaxy S5, in this case), but i get the following error on Lenovo K50-T5:
E/SpeechRecognizer: no selected voice recognition service
这是我的AndroidManifest.xml:
This is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lips.deafcommunication.deaflips">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppThemeNoBar">
<activity android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ChatInProgressActivity" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
android:configChanges="keyboardHidden|orientation|screenSize"
></activity>
</application>
</manifest>
推荐答案
这意味着用户根本没有安装语音识别器,或者没有配置要运行的语音识别器.您无法采取任何措施来解决此问题,用户必须安装一个.
That means either the user doesn't have a speech recognizer installed at all, or doesn't have one configured to run. There's nothing you can do to fix that, the user has to install one.
这篇关于SpeechRecognizer:未选择语音识别服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文