文本到语音停止发行 [英] Text-To-Speech STOP Issue

查看:114
本文介绍了文本到语音停止发行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有其中有显示器的屏幕上的连续选择更新,也文本到语音的选择更新的活性。这里的问题是当用户界面更新,如果我preSS家按钮,然后也文本到语音不停止。这是连续运行。我试图写在停止()关机()暂停() 以及在的destroy(),但仍其不工作。任何人都可以请让我知道如何停止的?

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?

请帮助我。

非常感谢。

推荐答案

这是很难说没有看你的code你在做什么错,但你应该能够调用<一个href=\"http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#stop%28%29\">TextToSpeech.stop()或<一个href=\"http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#stop%28%29\">TextToSpeech.shutdown()在你的的onPause 键,使这项工作。这是可能的任何原因停止失败,如果是的话那么你只是出于运气。这一直为我工作在6种不同的Andr​​oid设备的模型( MTTS 是我的文字转语音实例):

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();
        }       
    }

这篇关于文本到语音停止发行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆