We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 19 days ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
如果您不想使用
RecognizerIntent
进行语音识别,您仍然可以使用SpeechRecognizer
类来执行此操作。然而,使用该类比使用意图要棘手一些。最后一点,我强烈建议让用户知道他何时被记录,否则当他最终发现时,他可能会非常不安。编辑:一个小例子,灵感来自(但改变),
SpeechRecognizer 导致 ANR...我需要有关 Android 语音的帮助API
重要提示:从 UI 线程运行此代码,并确保您具有所需的权限。
If you don't want to use the
RecognizerIntent
to do speech recognition, you could still use theSpeechRecognizer
class to do it. However, using that class is a little bit more tricky than using the intent. As a final note, I would highly suggest to let the user know when he is recorded, otherwise he might be very set up, when he finally finds out.Edit: A small example inspired (but changed) from,
SpeechRecognizer causes ANR... I need help with Android speech API
Important: Run this code from the UI Thread, and make sure you have required permissions.
在您的活动中执行以下操作:
In your activity do the following:
Android 内置的是一个客户端活动(您通过意图启动),它捕获您的语音并将音频发送到 Google 服务器进行识别。你可以构建类似的东西。您可以自己托管 sphinx(或使用 Yapme.com 等云识别服务),自己捕获语音,将音频发送到识别器,然后将文本结果返回到您的应用程序。我不知道如何在不使用 Android 上的 Intent(或通过 Chrome)的情况下利用 Google 识别服务。
到目前为止,我所看到的普遍共识是,今天的智能手机确实没有足够的能力来进行类似狮身人面像的语音识别。您可能想尝试自己运行客户端识别器,但 Google 使用服务器识别器。
有关一些相关信息,请参阅:
What is built into Android (that you launch via the intent) is a client activity that captures your voice and sends the audio to a Google server for recognition. You could build something similar. You could host sphinx yourself (or use cloud recognition services like Yapme.com), capture the voice yourself, send the audio to a recognizer, and get back text results to your app. I don't know of a way to leverage the Google recognition services without use of the Intent on Android (or through Chrome).
The general consensus I've seen so far is that today's smartphones don't really have the horsepower to do Sphinx-like speech recognition. You may want to explore running a client recognizer for yourself, but Google uses server recognition.
For some related info see:
添加权限到 MANIFEST:-
单击按钮时调用 getSpeechInput()(使用监听器)
Add Permission to MANIFEST:-
Call getSpeechInput() when Button is clicked (Use Listeners)