1

I'm trying to set text-to-speech and speech-recognizer in my app,now i'm try when tts is running (not finish or stop) if speech-recognizer get voice/speech from user tts will stop and speech-recognizer will start, how can i solve this.

    welcomeSpeech = new TextToSpeech(this, this);
    new CountDownTimer(4000, 1500) {
        @Override
        public void onTick(long l) {
            speakOut("Welcome To MY New Application ");
        }
        @Override
        public void onFinish() {
            startSpeechToText();
        }
    }.start();

i'm tried this but in this code speech-recognizer start when tts will finish.i want if tts running (not finish or stop) at the same if user put voice tts will stop and speech-recognizer will start.

0 Answers0