Problem with text to speech

I have an activity in which there is a continuous update of the display on the screen, as well as updating text to speech. The problem here is that the user interface is updated if I press the home button, and also the text to speech does not stop. It works continuously. I tried to write stop()as well as shutdown()in pause()as well as in destroy(), but still not working. Can someone please let me know how to stop this?

Please help me.

Many thanks.

+5
source share
3 answers

, , , TextToSpeech.stop() TextToSpeech.shutdown() onPause . , , , . 6 Android- (mTts - TextToSpeech):

@Override
    protected void onStop()
    {
        super.onStop();

        if(mTts != null){
            mTts.shutdown();
        }       
    }
+12

TTS SDK , . synthesizeToFile() , TTS. MediaPlayer , . , synthesizeToFile() , , .

+1
@Override
public void onDestroy() {
    if (tts != null) {
        tts.stop();
        tts.shutdown();

    }
    super.onDestroy();
}

( , )

+1

All Articles