I need to use speech input to insert text. How can i detect keyword when I'm speaking ?
Can i do this with Android Speech Input or I need external library ?
Any ideas ?
Thanks
Keyword detection task is different from a speech recognition task. While second tries to understand the text being spoken and check all possible word combinations, keyword spotting usually check two hypothesis - word is here or garbage is here. Its way more efficient to check keyword presence but it requires custom algorithm. You can implement one with the open source speech recognition toolkit like CMUSphinx.
http://cmusphinx.sourceforge.net
Which runs on Android too, you can check
Voice command keyword listener in Android
to see how to integrate it.
Absolutely.
See this for some code that detects the "magic word"
Just launch an Intent with ACTION_RECOGNIZE_SPEECH and then check the results for your keyword. Checking for the keyword can be complicated, but this code should get you started.
https://github.com/gmilette/Say-the-Magic-Word-
I used the Snowboy library for this task
Website: https://snowboy.kitt.ai
Github: https://github.com/kitt-ai/snowboy
It is a C library but it can be included in Android code using the JNI. The only downside to it is that you have to train it with audio samples if you want to use another keyword than the ones that come with the library.
Related
I would like to implement offline voice recognition in my app. But I want it for two purposes:
For a small set of commands (play, stop, previous, next and a couple of others);
For a list of a few hundred bird names.
To implement (1), it seems to me a bad idea (slower and resource consuming) to use the full voice recognition force of android. In my mind, it would be easier to tell my app to only interpret a few words. That is, to use my own dictionary, telling my app to "use only these 10 words".
To implement (2) is similar to (1), but with a few hundred instead of 10.
Does this makes sense, and if so is there an easy way to implement it? Is it worth it?
Thanks!
L.
You can implement your app using CMUSphinx on Android. CMUSphinx tutorial is here:
http://cmusphinx.sourceforge.net/wiki/tutorial
The language models to recognize limited set of words are described here
http://cmusphinx.sourceforge.net/wiki/tutoriallm
You can use keyword spotting mode to recognize few commands.
Pocketsphinx on Android is described here:
http://cmusphinx.sourceforge.net/wiki/tutorialandroid
The demonstration includes the way to switch recognition modes from 10 words to few hundred words as you intend.
I am trying to implement voice recognition in Android. I have followed various tutorials for the same which say, we need to give call to RecognizerIntent with RecognizerIntent.ACTION_RECOGNIZE_SPEECH and start activity for result. So when we speak,we get a set of values from the google server by providing RecognizerIntent.EXTRA_RESULTS. This is working fine. But what I need to do is, I need to provide a set of strings to the voice recognition engine, so when we say something, it will match what we have said with the provided set of strings and returns only one matched string.So I need to provide the recognizer engine some set of values from which it should give me the matched word. Can this be done?
This can be done with pocketsphinx, see keyword matching mode in tutorial
http://cmusphinx.sourceforge.net/wiki/tutorialandroid
I use Dio dictionary, function gesture on screen get text to search
Library that in Android can make to be the function of this?
I think you want something like a handwriting recognition library. It seems you want to enable the users to write something on the screen ,when app is ON and then you can convert it to text and use it. There are many existing questions which might help you find a handwriting recognition library. See:
Handwriting recognition API's for android applications
https://stackoverflow.com/questions/768664/recommendations-for-handwriting-recognition-libraries-packages-in-java
You can also use Tesseract library to recognize handwriting. See:
Tesseract handwriting with dictionary training
I haven't used any so I am not sure which one is the best but I hope that these links help you.
Doing some research I have found some different speech to text API's for Android.
Pocket Sphinx
Android Native API
I have the following requirements:
Must be able to support offline speech recognition (I'm not sure
if the Android API can do this)
Must be able to detect and
respond immediately to every word said. I would rather this than
detecting an entire sentence. I could split the returned sentence
into and array though and get each word.
The detection needs to
be processing in the backgound (no popups or anything as the Android
API seems to do)
Can someone recommend an API that is capable of my requirements.
Pocketsphinx meets all your requirements. What you call the "Android Native API" is basically a set of interface definitions and it does not contain the notion of offline/online.
You can also implement these interfaces using Pocketsphinx, since it supports things like partial results, confidence scores, n-best results etc. This way the implementation becomes available to any Android app. Maybe somebody has done it already, but I'm not aware of it.
i have used the code provided in this link for the speech recognition. in emulator it is saying recognizer not present,so i installed it on mobile. when i click on speak button it is working. but when i speak some names "rajesh" it is showing some possible verbs and all but not the name. but i want to use the input to select a contact from the address book in order to make a call . so please tell me how to carry on in this direction. one more thing, every time i need to develop the code in eclipse then install it on mobile and then check for output. is there any alternative to edit and check the app code in the mobile from eclipse.
please provide me any possible links. i want to develop a call app for blind,if the voice recognition does not work, what else could be done to take input from the user.
Names are hard for Speech recognition. There are more possible names in the world than words in any dictionary, so being able to recognise any arbitrary name is hard. Though common names are easier.
Anyway, if you want to recognise a customized list of words/names, You might want to look at Dragon Mobile from Nuance. Here is a copy-and-paste from another similar question I answered:
If you use 3rd party Android recognition from Nuance (The people behind DragonDictate), it supports a "grammar mode" where you can somewhat restrict the phrases that will be recognised during recognition.
Importantly, if you add unusual names into a Custom Vocabulary, they SHOULD become recognizable (Complex pronunciation issues aside).
You can find information if you dig through:
http://dragonmobile.nuancemobiledeveloper.com ,
looking for 'Custom Vocabularies'. Grammar mode is essentially a special mode of custom vocabularies.
At the time of writing, there was a document here that makes some mention of grammar mode:
http://dragonmobile.nuancemobiledeveloper.com/downloads/custom_vocabulary/Guide_to_Custom_Vocabularies_v1.5.pdf - It only really becomes clear when you try to progress in their provisioning web GUI.
You have to set up an account, and jump through other hoops, but there is a free tier. This is the only potential way I have found to constrain a recognition vocabulary.
Well, short of running up PocketSphinx, but that is still described as a 'Research' 'PreAlpha'.
No, I don't work for Nuance. Not sure anyone does. They may have all been eaten by zombies. You would guess as much reading their support forums. They never reply.