Continuous Speech Recognition Android - Without Gaps
Solution 1
try looking at a couple other api's....
speech demo : has source here and is discussed here and operated on CLI here
you could use the full duplex google api ( its rate capped at 50 per day )
Or if you like that general idea check ibm's watson discussed here
IMO - its more complex but not capped .
Solution 2
I'll recommend using CMUSphinx to recognize speech continuously. To achieve continuous speech recognition using google speech recognition api, you might have to resort to a loop in a background service which will take too much resources and drains the device battery.
On the other hand, Pocketsphinx works really great. It's fast enough to spot a key phrase and recognize voice commands behind the lock screen without users touching their device. And it does all this offline. You can try the demo.
If you really want to use google's api, see this
Solution 3
There are options like:
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, 2000); // value to wait
or
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS, 2000);
These ceased to work on Jelly Bean and above, but work on ICS and below - not sure if intended or a bug!
Related videos on Youtube
Ronen Rabinovici
Love programming, science & history. On Speechnotes.co & ttsreader.com research & development teams. Check my Jewish History Timeline website and app for Jewish History.
Updated on August 03, 2022Comments
-
Ronen Rabinovici over 1 year
I have an activity that implements
RecognitionListener
. To make it continuous, every timeonEndOfSpeech()
I start the listener again:speech.startListening(recognizerIntent);
But, it takes some time (around half a second) till it starts, so there is this half a second gap, where nothing is listening. Therefore, I miss words that were spoken in that time difference.
On the other hand, when I use Google's Voice input, to dictate messages instead of the keyboard - this time gap does not exist. Meaning - there is a solution.
What is it?
Thanks
-
Ronen Rabinovici almost 9 yearsThanks, though Pocketsphinx does not work well for natural - speech dictation (it works great for a limited grammar - great for commands), and doesn't the solution in the link to google's api result in the same problem as I posted?
-
Ronen Rabinovici almost 9 yearshttp streaming to 3rd party services seems the only solution at this point.
-
Ruchir Baronia over 8 yearsHow do I download pocketsphinx
-
Nana Ghartey over 8 years@RuchirBaronia Download from the official site cmusphinx.sourceforge.net
-
Ruchir Baronia about 8 yearsHow can I implement it in a service? Thanks!
-
Hamza over 6 yearsdo you have example code for android because i useing this and i add hot words like ok light but it still tregir on others words