我正在关注本教程以在我的应用程序中实现文本到语音
http://www.androidhive.info/2012/01/android-text-to-speech-tutorial/
演讲受到打击。请参考下图
添加代码后
更改以下代码行:-
TextToSpeech textSpeach = new TextToSpeech(this, this);
改成
TextToSpeech textSpeach = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
}
});
问题原因:-您this
在两个参数中传递上下文,TextToSpeech
因此发生此问题,第二个是TextToSpeech
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句