简体   繁体   English

在Android应用中集成Google语音识别功能

[英]Integrate Google Voice Recognition in Android app

I want to introduce a new feature into my app: permanent voice recognition . 我想在我的应用程序中引入一项新功能: 永久语音识别

First of all I followed these posts: 首先,我关注了这些帖子:

Voice recognition 语音识别

Speech recognition in Android Android中的语音识别

Offline Speech Recognition In Android (JellyBean) Android中的离线语音识别(JellyBean)

and more others, plus other posts from different websites. 以及更多其他人,以及来自不同网站的其他帖子。

Problem: What actually I'm trying to do is to have a permanent voice recognition without displaying google's voice activity. 问题:我真正要做的是在没有显示谷歌语音活动的情况下进行永久语音识别。 For example: When I start the application the voice recognition should start and listen. 例如:当我启动应用程序时,语音识别应该开始并收听。 When the recognizer matches some words then my app will do different actions accordingly. 当识别器匹配某些单词时,我的应用程序将相应地执行不同的操作。 I do not like to press a button every time I want to do voice recognition, and also I do not like to appear anything on the screen to talk to. 我不想每次想要进行语音识别时都按下按钮,而且我也不喜欢在屏幕上出现任何与之交谈的内容。 Can I do that? 我能这样做吗?

Any suggestions are welcome. 欢迎任何建议。 Thank you! 谢谢! :) :)

Android can use voice recognition without any GUI. Android无需任何GUI即可使用语音识别。 You can use SpeechRecognizer class to do this. 您可以使用SpeechRecognizer类来执行此操作。 But google doesn't allow you to use theirs voice tools for long time recognition. 但谷歌不允许你使用他们的语音工具进行长时间识别。 After 5-7 seconds of silence it will be stopped. 沉默5-7秒后,它将停止。

If you want to use limited comands vocabulary, you can use offline continious recognition like PocketSphinx . 如果您想使用有限的命令词汇表,您可以使用像PocketSphinx这样的离线连续识别。

对于长时间识别,您可以使用:

intent.putExtra("android.speech.extra.DICTATION_MODE", true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM