将Google语音识别集成到Android应用中 [英] Integrate Google Voice Recognition in Android app

查看:351
本文介绍了将Google语音识别集成到Android应用中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中引入一项新功能:永久语音识别.

I want to introduce a new feature into my app: permanent voice recognition.

首先,我关注了这些帖子:

First of all I followed these posts:

语音识别

Android中的语音识别

Android(JellyBean)中的离线语音识别

以及更多其他内容,以及来自不同网站的其他帖子.

and more others, plus other posts from different websites.

问题: 我实际上想做的是在不显示google语音活动的情况下获得永久性语音识别.例如:当我启动应用程序时,语音识别应该启动并收听.当识别器匹配某些单词时,我的应用程序将相应地执行不同的操作.我不想每次都想进行语音识别时都按一个按钮,而且我也不喜欢在屏幕上出现任何要交谈的内容.我可以那样做吗?

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可以在没有任何GUI的情况下使用语音识别.您可以使用 SpeechRecognizer 类来执行此操作.但是google不允许您使用他们的语音工具进行长时间识别.沉默5到7秒钟后,它将停止.

Android can use voice recognition without any GUI. You can use SpeechRecognizer class to do this. 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.

如果您想使用有限的司令部词汇,则可以使用离线连续识别,例如 PocketSphinx .

If you want to use limited comands vocabulary, you can use offline continious recognition like PocketSphinx.

这篇关于将Google语音识别集成到Android应用中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆