【问题标题】:Hide Google Voice recognition隐藏谷歌语音识别
【发布时间】:2015-07-14 16:07:03
【问题描述】:

我正在使用 Google 语音识别,并想隐藏带有 Google 的弹出窗口和正在显示的麦克风。这是我的代码:

Intent intent = new Intent(
                    RecognizerIntent.ACTION_RECOGNIZE_SPEECH);

            intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, getResources().getString(R.string.ttslang));

            try {
                startActivityForResult(intent, RESULT_SPEECH);
            } catch (ActivityNotFoundException a) {
                Toast t = Toast.makeText(getApplicationContext(),
                        getResources().getString(R.string.notts),
                        Toast.LENGTH_SHORT);
                t.show();
            }

我认为我已经看到了这样的应用程序,我认为这是可能的。如果是的话,有人知道怎么做吗?

非常感谢!

【问题讨论】:

标签: android speech-recognition voice


【解决方案1】:

为此,您需要使用SpeechRecognizer。一个例子可以在here找到。

很容易实现:

SpeechRecognizer recognizer = SpeechRecognizer.createSpeechRecognizer(this);       
recognizer.setRecognitionListener(new RecognitionListener() { ... });  

侦听器捕获事件并相应地处理它们。

【讨论】:

  • 在此处添加一些代码 sn-p 以便用户了解总体思路
  • 我看到的每一个代码,我只能得到一个字符串数组。我怎样才能获得“最佳结果”(我已经使用 Google Voice Input)?
  • 刚刚得到返回数组的第一个元素,还是谢谢
猜你喜欢
  • 1970-01-01
  • 2016-11-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-06-30
相关资源
最近更新 更多