[possibly duplicate] But I didn't find answers to my questions below.
Is it possible to run voice recognition as a service?
I would like to implement something like this: I need to call a number though my phone through voice recognition is in sleep mode.
Is there any sensor to detect the voice apart from the voice recognition?
I'm working with Voice Recognition, and i think it's impossible to run voice recognition as a service. Because of:
Problem Performance : to run as service you must call Voice Recognizer continous.
Don't have API Supports: to run as service you must use Service and call Voice Recognizer continous.
So, find other solution instead Voice Recognition.
Related
I have app which have running offline voice recognition service listening for one keyword.
If keyword is spoken is triggered google speech recognition service which displays image like this and return text of spoken sentence.
I would like to know two things:
How to make app processing Google speech to text if app is not in
foreground or screen is locked?
How to avoid "Speak Now" Dialog? (I would like to use some custom
UI component)
Thanks for any advice.
If you want to run speech recognition in the background I would strongly advice you to stay way from google speech. You can currently run speech recognition in the background but it will cause a speech activation sound to be triggered every 3-5 seconds. See the question below:
Android Speech Recognition as a service on Android 4.1 & 4.2
Currently this sound runs on the music channel for some reason and therefore if you try to mute it music will be muted as well.
If you want to implement this the "nice" way I would suggest you take a look at cmusphinx.
I use the speech recognition and text-to-speech but I would like to mute the "beep" sound of the speech recognition and then unmute for hear the vocal synthesis.
I succeed to mute but when I want to set the volume at its maximum, it applies to the phone and not to my app.
How to manage this ?
Thanks
There is an answer you can refer to here regarding how to loop the recognition and silence the beep.
Whenever you call setStreamMute() it is for the entire device, not just your application.
The issue here is that the Google Search Application (4.1+) is controlling the beep and the audio, it is not part of the recognition API.
If you open Google Now whilst you have music playing and press the listen button, you'll note that the music stops until the recognition and voice interaction finishes, this is because the app is 'ducking' the audio.
There is nothing as developers we can do about this behaviour (other than use another Speech Recognition Provider) and it's frustrating, as voiced here.
Until we manage to persuade Google to allow us to pass parameters such as 'offline' and 'no audio prompt' in the Recognition Intent, there's nothing we can do but rant.....
I have an Android application that uses speech recognition in an Activity. The GUI doesn't do anything except for contain the speech recognition objects. I would like to port this over to a service so I can talk to the application while it's running in the background.
However, as far as I know, the speech recognition service has to use onActivityResult, which is unavailable for Services. Is there a way to either contain an Activity in a Service such that its GUI is not displayed, or perform speech recognition in a service instead of an activity?
See Google's voice search speech recognition service - it might have some useful links to information. I don't think you can do non-Gui voice recognition because the recognizer is only exposed as the recognizer intent.
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.
what if you have your service wake up an activity when it detects any incoming audio signal,
that acts like a widget only taking up a small part of the screen or even just a single pixel, then call voice recognition from the invisible activity?
Just an idea, I don't remember if a widget can be an activity or if you can make an activity that doesn't take up the screen.
I noticed that as soon as a voice recognition activity starts, text-to-speech output stops.
I understand the rational: TTS output could be "heard" by the voice recognition engine and interfere with its proper operation.
My question: Is this behavior hard-coded into the system, or can it be modified by a setting or parameter (in the API)?
Must the activity simultaneously use recognition and TTS? If the recognition can wait (functionally speaking), force the event to spawn the RecognizerIntent only onUtteranceCompleted
This is pure speculation, but there must be some common feature that can only be used by TTS and recognition one at a time (both apis come from android.speech.*)
I'm working on an application that would require continuous speech recognition. The app will listen for only a few defined keywords, but once the listener gathers the users voice input, it will need to keep listening for more keywords until the user stops the listener.
The best solution I've found is the Nuance speech recognition library, but this isn't perfect and it could get very expensive. Has anyone else been able to get this type of functionality working?
You can try the Oxford API of Mircosoft
This can give you continuous real time speech recognition, and then you can look for special keywords. Maybe it's an overkill in your case so be sure to check more options !