More specifically, is it possible for an non-android Java application to use android's speech recognition. I figured I could use cmu sphinx or something similar, but the whole sending voice input to a server that does the real recognition and returns an array of strings seems to be much easier to set up an reduces the size of the project. Also, if this is possible, the project will be able to use Google's (ginormous) speech corpus.
2 Answers
More specifically, is it possible for an non-android Java application to use android's speech recognition.
No. AFAIK, it is not open source.

- 986,068
- 189
- 2,389
- 2,491
-
I thought all of android was open-source – Doug Molineux Apr 26 '11 at 21:48
-
1@Pete Herbert Penito: The OS is. Some drivers aren't. Some apps aren't. Google Maps (including the add-on supplying `MapView`) are not. Speech recognition, AFAICT, is not. The APIs are there, and you can write your own recognizer, so somebody creating a device from the open source project could still offer speech recognition. – CommonsWare Apr 26 '11 at 22:04
-
@CommonsWare, but the binaries are there, if they could be added into a java project as a library and then have the some way for the application to fire up a RecognizerIntent. If there was a way for an android activity to run on a standard jvm, then this shouldn't be too difficult – Niraj Apr 26 '11 at 23:23
-
@Niraj: "but the binaries are there" -- no, they are not, unless you are going to pirate them. "if they could be added into a java project as a library" -- even if they were available, Java does not run Dalvik bytecode. "then have the some way for the application to fire up a RecognizerIntent" -- which only works on Android, and implies the entire Android UI framework as well. – CommonsWare Apr 26 '11 at 23:27
-
@Niraj: And, of course, you would be using the speech recognition Web service from Google without authorization, even if you got past all of the above issues. I suggest that you use an existing open source solution or a properly-licensed commercial solution. – CommonsWare Apr 26 '11 at 23:31
-
oh, I didn't know Dalvik had a completely different instruction set. I thought there would be some overlap. I guess my original question doesnt make much sense in that context. I suppose if it was possible theres every possibility that they could just block non-authorized applications at some point of time. – Niraj Apr 27 '11 at 08:04
From that thread:
I don't know if the Android sources are available, but Google did upgrade Chrome to include speech recognition and those sources are available. I don't think that Google wants people to call this service directly, and it likely violates some terms of service somewhere if you do, but check out http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/ to see the service behind Chrome speech recognition which I suspect is similar to Android.
As that article says:
http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/
It looks like the audio is collected from the mic, and then passed via an HTTPS POST to a Google web service, which responds with a JSON object with the results. Looking through their audio encoder code, it looks like the audio can be either FLAC or Speex- but it looks like it's some sort of specially modified version of Speex- I'm not sure what it is, but it just didn't look quite right.
Also, see Google's voice search speech recognition service - it might have some useful links to information.
Alternatively, there are commercial speech recognition services available see http://yapme.com/speech-cloud.html, Nuance, http://www.ispeech.org/developers, and others listed at Server-side Voice Recognition.

- 1
- 1

- 13,097
- 15
- 66
- 100
-
I love the html post solution (though there is a chance that they might just close it at some point of time without any warning). – Niraj Apr 27 '11 at 07:51