2

I am working on an android application where the application listens for the Japanese words and translate it into English and prints it on the screen.

I am using the Google Speech To Text Listener. But the problem is that it stops listening after a few seconds and I have to start the listener again.

Moreover, Is it possible to get a single accurate result rather than an array from the Listener?

This is my intent initialization code.

intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
                String jap=sharedpreferences.getString("jap","");

                //Putting Japanese intent to Voice Recognition if the locale is set to japanese
                if(jap!=""){
                    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,"ja-JP" );                }
                else
                    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.ENGLISH);

                intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test");
                intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,15);
                sr.startListening(intent);
Shreyansh Patni
  • 401
  • 2
  • 17
  • The native Android Google Recognition Service does not support continuous listening. There is a hack here - http://stackoverflow.com/q/14940657/1256219 Otherwise, you'll need to use another service provider. Each of the results comes with a confidence score, which you can use as the 'single most accurate'. – brandall Oct 04 '16 at 07:40
  • 1
    I think google already provides sorted results on the basis of the confidence score. Isn't it? – Shreyansh Patni Oct 04 '16 at 09:29
  • 1
    Yes, each result has a corresponding confidence score in the bundle of results. – brandall Oct 04 '16 at 10:02
  • try a different api and then include config for "stream" and "continuous recognition" ... https://cloud.google.com/speech/reference/rest/v1beta1/StreamingRecognitionConfig – Robert Rowntree Oct 05 '16 at 14:48

0 Answers0