gotev / android-speech

Android speech recognition and text to speech made easy
http://gotev.github.io/android-speech/
Apache License 2.0
473 stars 156 forks source link

Continuous recognition #27

Closed jaag12 closed 5 years ago

jaag12 commented 5 years ago

Is a continuous recognition possible with this library?

gotev commented 5 years ago

No, you need to use Google Cloud Speech

Anshul1507 commented 4 years ago

Yes, continuous recognition possible.

you can add this in onSpeechResult method after setting text,

       Speech.getInstance().stopTextToSpeech();

            Handler handler = new Handler();
            handler.postDelayed(new Runnable() {
                @Override
                public void run() {
                    try {
                        Speech.getInstance().startListening(progress, MainActivity.this);
                    } catch (SpeechRecognitionNotAvailable speechRecognitionNotAvailable) {
                        speechRecognitionNotAvailable.printStackTrace();
                    } catch (GoogleVoiceTypingDisabledException e) {
                        e.printStackTrace();
                    }
                }
            }, 100);