Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text-To-Speech STOP Issue

I have an activity in which there is a continuous updation of display on the screen and also updation of text to speech. The problem here is while the UI is updating, if I press home button then also the text to speech is not stopped. It is running continuously. I have tried to write the stop() and also shutdown() in pause() and also in destroy() but still its not working. Can anyone please let me know how to stop that?

Please help me.

Thanks a lot.

like image 857
Lavanya Avatar asked Aug 25 '11 04:08

Lavanya


1 Answers

It is hard to tell without looking at your code what you are doing wrong, but you should be able to call TextToSpeech.stop() or TextToSpeech.shutdown() in your onPause and make that work. It is possible the stop fails for any number of reasons, and if it does then you're just out of luck. This works for me consistently on 6 different models of Android device (mTts is my TextToSpeech instance):

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

        if(mTts != null){
            mTts.shutdown();
        }       
    }
like image 141
Femi Avatar answered Sep 25 '22 09:09

Femi