首页 > 解决方案 > 在 android studio 中使用语音识别器

问题描述

我在我的 android 应用程序上使用 SpeechRecognizer 意图,但我想知道此功能是否免费,或者我必须向 Google 付费才能使用它。它是否使用此 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();
    }

标签: androidspeech-recognition

解决方案


推荐阅读