android - 在 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();
}
解决方案
推荐阅读
- c++ - 为每个奇数 j 索引查找多维数组模式
- python - 用字典中的单词替换字符串的每个字母
- bash - jq:在从 json 文件和 bash 标准输出读取输入时插入新对象
- reactjs - 反应工具提示问题中的香草引导程序
- java - Java 移动对象(一个简单的机器模拟器)
- html - 包装时有没有办法改变物品的顺序?
- autohotkey - 为我的 AutoHotkey 功能使用加拿大多语言标准键盘时重新启用右键 Ctrl?
- python-3.x - 处理 webhook 时的并发问题
- java - 安装 e(fx)clipse 后我的 Eclipse 无法启动
- mysql - 在 WITH ROLLUP 上排序