Android not acknowledging TTS Engine

后端 未结 6 1008
孤独总比滥情好
孤独总比滥情好 2021-02-04 13:10

I am developing a very simple app in here. It\'s for my Cerebral Palsy daughter. It\'s just a big YES and NO buttons, so she can press them when requested.

Well... I am

6条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 13:54

    I had the same problem and solved. Maybe it's a timing issue in bounding, not sure, but a simple action before speak helped me. Anyway I did this:

    mTts = new TextToSpeech(this, this);

    String engine = mTts.getDefaultEngine();

    mTts = new TextToSpeech(this, this,engine);

    Log.d("","...something here...");

    Then when I hit my speak button, it speaks. You should watch your variable status on OnInit method. Maybe a separate thread can help talking in the app.

    By the way, if you are sure TTS is installed, you can remove the block Intent checkIntent = new Intent(); for checking.

    I definitely hope this helps you.

提交回复
热议问题