0

因此,当用户想要执行语音命令但找不到任何解决方案时,我已经广泛搜索了有关删除 Google 语音识别 UI 对话框的问题的某种解决方案。我正在尝试实现一个向用户显示菜单的应用程序,用户可以单击选项或大声说出将打开新页面的选项。到目前为止,除非我使用 Googles RecognizerIntent,否则我无法实现这一点,但我不希望弹出对话框。有人有想法么?或者有没有人解决了这个问题或找到了解决方法?谢谢

编辑:作为一种妥协,也许有一种方法可以将对话框移动到屏幕底部,同时仍然能够查看我的菜单?

4

2 回答 2

1

如何在没有 Android 手机中烦人对话的情况下使用语音识别

我很确定 Nuance/Dragon 会对使用其服务的生产或商业应用程序收费。如果这只是一个演示,您可以使用开发者帐户。Android 语音服务对所有 Android 应用程序都是免费的。

于 2011-06-14T22:27:45.370 回答
1

你知道你可以用谷歌的 API 来做到这一点。

您可能一直在查看有关语音识别意图的文档。请查看语音识别 API 的 RecognitionListener 接口。

这里有一些代码可以帮助你

public class SpeechRecognizerExample extends Activity implements RecognitionListener{    

    //This would go down in your onCreate

    SpeechRecognizer recognizer = SpeechRecognizer.createSpeechRecognizer(this);
    recognizer.setRecognitionListener(this);

    //Then you'd need to start it when the user clicks or selects a text field or something

    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    //intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "zh");
    intent.putExtra("calling_package",
            "yourcallingpackage");

    recognizer.startListening(intent);

    //Then you'd need to implement the RecognitionListener functions - basically works just like a click listener

这是 RecognitionListener 的文档:

http://developer.android.com/reference/android/speech/RecognitionListener.html

于 2011-06-14T22:44:28.220 回答