I need to use a background service to launch my application with voice command even when the screen is locked. For example when I say "start" the screen will be unlocked and the application launches automatically, I tried to make this code work https://github.com/gast-lib/gast-lib/blob/master/library/src/root/gast/speech/activation/SpeechActivationService.java
but I don't know how to use that and how to do the service with the activity .
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 as I've demonstrated above, see this
Related
I have an activity that implements RecognitionListener. To make it continuous, every time onEndOfSpeech() 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
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
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 .
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!
I'm using googles voice recognition to gather a response from a user. My application wakes up and 'speaks' to the user (while the device is still locked). At this point I want to receive a voice command from behind the lock screen and use it to do stuff in the background without the user having to touch the phone. What is happening at the moment is that the waking up and text-to-speech stuff is fine, but the speech recognizer won't recognise speech from behind the lock screen. Is this possible?
http://developer.android.com/reference/android/speech/RecognizerIntent.html#ACTION_RECOGNIZE_SPEECH
CMUSphinx is a real solution for this problem. To achieve this using google speech recognition api, you might have to resort to continuous speech recognition which takes 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.
I want to make an android application that allow user change the voice during phone call. For example: You are a man, you can change the voice to a woman or robot when talking over phone. It is like a funny prank.
I work around android's API and google for some days but still have no idea. Some one told is impossible but I see some app on google play can do:
https://play.google.com/store/apps/details?id=com.gridmob.android.funnycall
So I think there are some ways to do that.
I think about recording and play back by using AudioTracker but I have 2more problem:
1. I cannot mute the voice from phone call, so the phone only play my sound after processing
2. record and process will make a long delay (slow-realtime)
Can any one share some solution for this?
The app you linked isn't changing voices on the phone: it uses SIP (or similar) to place a call through the authors' servers and the voice changing happens there. That's why you only get a small number of free minutes of use before you have to pay them.
Yes it uses a sip server to do this process. The reason you cannot actually create an app that does this on the phone is because of two things. The first thing being, sound processing for the phone is locked. You can't unlock this because its strictly engineered through hardware not software. A pc can do this because it uses a standard sound card in which software can modify its frequencies. The second thing is phone manufactures are required to design their phones in a standard format. There are laws that force these companies to make it impossible to do any voice morphing. It is against the law to impersonate someone you are not, over any telephone network.
Hard way
You get the input voice, you use voice recognition to detect the words, then you use speech-to-text with your desired voice as output.
Less hard way
Sound processing: Changing frequencies, amplitude etc.
I don't have much experience with Android, but was asked by a hearing-impaired friend if there is a way to essentially "stream" voice to text on a mobile device. I've used and looked into the android built in api, but it seems that only sends the speech off for processing after the speech input is completed. I'm looking for something that works contiguously (similar to how Dragon works with microsoft word).
Perhaps there is already an app that does this. If not, is there a way to implement this with the current Android OS/API?
Any suggestions appreciated.
As you've mentioned, the speech-to-text recognition is sent to Google for processing. This can take enormous computing power, which current devices simply can't handle (yet). Because everything is processed server-side, you won't be able to do immediate speech recognition in real time directly on the phone.
It's possible that somebody has created a 3rd-party library to do this, but I'm not aware of any. Even so, it would probably have some significant limitations or reduced accuracy.
You can use this Extra for the Recognizer Intent:
String EXTRA_PARTIAL_RESULTS Optional boolean to indicate whether partial results should be returned by the recognizer as the user speaks (default is false).
http://developer.android.com/reference/android/speech/RecognizerIntent.html#EXTRA_PARTIAL_RESULTS
Hey guys, I was wondering if it were possible to translate audio without having to call a recognizer intent (ie a dialog that says you are recording audio). I want to be able to recover the results of the voice recognition every 2 to 3 seconds or so and plan to use this with a bunch of listviews. Is this possible? If so any ideas? Thanks!
Edit: I forgot to mention that I am playing around with android.speech.SpeechRecognizer but so far, in my implementation of the RecognitionListener interface all I have been able to get from ddms is that there is a client side error. Nothing else seems to be called. Also, is it essential that I implement a RecognitionService? I know that the example in the API is just that. If so, how would I create and use this service? Thanks again.
Speech recognition does not work in the Emulator. You need a device.
I just posted some working code skeleton stuff in another thread -
Voice Recognition Commands Android
The speech recognizer can be triggered every few seconds without UI. You might need to write your own code to decide when is good to record and when is not (you get an audio buffer you could peek through) - or your could do something in your own UI.
I think you could re-trigger it over and over again. Not sure it'd work perfectly but worth a try.
It is impossible in Android < 2.1 and probably in 2.2
When I asked a Google support person, he said, "Maybe you can figure out what packets are being sent and then just make a direct web call"
Wow.