在android studio中使用Speech Recognizer

时间:2018-05-18 08:49:27

标签: android speech-recognition

我在我的Android应用程序上使用SpeechRecognizer意图,但我想知道这个功能是免费的,还是我必须向谷歌付费使用它。 它是否使用此Goolge API:https://cloud.google.com/speech-to-text/docs/

这是代码:

Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    i.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "de-DE");
    i.putExtra(RecognizerIntent.EXTRA_PROMPT, "");

    try
    {
        startActivityForResult(i, 100);
    }
    catch (ActivityNotFoundException a)
    {
        Toast.makeText(this,"",Toast.LENGTH_LONG).show();
    }

0 个答案:

没有答案