看起来谷歌已经从Google即时版为第三方应用程序提供了离线语音识别功能.它被名为Utter的应用程序使用.
有没有人看过如何使用这个离线语音rec进行简单的语音命令的任何实现?您是否只使用常规的SpeechRecognizer API并自动运行?
android speech-recognition offline speech-to-text google-now
I tried a lot but can´t find it out, so I hope you can help me.
I am trying to build my own voice recognition app, which doesn´t show up the dialog.
I already wrote some code and it works quite fine, but my problem is that the recognizer seems to stop without any errors or other messanges in the LogCat.
A strange fact is that the "onRmsChanged" from the "RecognitionListener" interface is still called all the time, but no …
在我的基于语音识别的应用程序中,我有时会收到ERROR_RECOGNIZER_BUSY.直觉上,这需要...... 重试,对吧?
问题是这个错误是非常无证的,所以很明显我有些问题可能是在该领域更有经验的人能够回答:
我们非常欢迎您经验丰富的见解.谢谢.
我使用以下代码通过谷歌调用语音识别器:
// This is a demonstration of Android's built in speech recognizer
package com.example.voiceinputbuiltintest;
import java.util.ArrayList;
import java.util.Locale;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.speech.RecognizerIntent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity {
private static final int VOICE_RECOGNITION = 1;
Button speakButton ;
TextView spokenWords;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
speakButton = (Button) findViewById(R.id.button1);
spokenWords = (TextView)findViewById(R.id.textView1);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; …Run Code Online (Sandbox Code Playgroud) 无论如何,我可以在离线模式下使用Android的Voice to Text功能.
在给定的示例VoiceRecognition.java中,它使用目标RecognizerIntent.ACTION_RECOGNIZE_SPEECH启动和活动.
这是否意味着需要先安装任何其他apk才能使用此功能,或者我是否需要编写自己的应用程序来启动此意图.
我一直在寻找这个,但是很困惑......
这是我用过的代码..
private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;
private ListView mList;
/**
* Called with the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Inflate our UI from its XML layout description.
setContentView(R.layout.voice_recognition);
// Get display items for later interaction
Button speakButton = (Button) findViewById(R.id.btn_speak);
mList = (ListView) findViewById(R.id.list);
// Check to see if a recognition activity is present
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(
new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), …Run Code Online (Sandbox Code Playgroud)