Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Development of application similar to "Google now" - is it possible to use voice recognition without key input?

I'm trying to develop a cool application that uses the TTS engine and speech recognition. So far it's ok but I want more. I would like to create a service (I think a service is the right way), that is always "listening" and when someone says "ok google" or something else , the speech recognition starts, like google now. For example, if you say "ok google" google now starts. I don't know where to start so I'm asking directly here if it's possible. I tried looking at this thread [here] (Listening for keywords at all times, like "Ok google" on 4.4) and the last answer talked about a service, as I thought. Can someone help me with my code?

For example this is the code to start speech recognition by tapping a button:

/**
 * Instruct the app to listen for user speech input
 */
private void listenToSpeech() {
    //start the speech recognition intent passing required data
    Intent listenIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    //indicate package
    listenIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getClass().getPackage().getName());
    //message to display while listening
    listenIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Say a word!");
    //set speech model
    listenIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    //specify number of results to retrieve
    listenIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 10);
    //start listening
    startActivityForResult(listenIntent, VR_REQUEST);
}

Do you think it's possible to start that listenIntent only with voice and without pressing any button? This is what i mean.

like image 693
Atlas91 Avatar asked Mar 14 '14 09:03

Atlas91


People also ask

Is voice recognition device an input device?

When using voice recognition to control actions on your computer or type for you, it's a type of input known as voice input.

How do I use Google offline speech recognition?

You can activate this by going to Settings - Language and Input - Voice Input and touch the cog icon next to Enhanced Google Services. Choose "Offline Speech Recognition" and select the "All" tab to download your preferred language if it's not already installed.

Is Google Now speech recognition software?

Voice Recognition. Type with your voice. Dictation turns your Google Chrome into a speech recognition app. You can use Google Chrome as a voice recognition app and type long documents, emails and school essays without touching the keyboard.

How does Google's voice recognition work?

A Speech-to-Text API synchronous recognition request is the simplest method for performing recognition on speech audio data. Speech-to-Text can process up to 1 minute of speech audio data sent in a synchronous request. After Speech-to-Text processes and recognizes all of the audio, it returns a response.


1 Answers

(Updated 06.01.2018: added some bits to previous answer)

you can have reference with Saiy, previously Utter

this app uses hot word detection as "Google Now".

and there is no such API provided by Android to perform such operation.

Saiy app is now opensource with repository here. From what little I saw in the code, it seems to have implemented the functionality using CMU Pocketshinx.

Don't forget to post your findings.

Note- its very CPU-intensive and battery consuming to listen all the time in background.

like image 102
Arnav M. Avatar answered Sep 28 '22 18:09

Arnav M.