2

I had a read aloud menu option which was working fine with the API 15. But fails to work in the API 19. There is no error as such in the code but clicking on the menu doesn't lead to anything. Here is the code: I have added this in the onCreate

 mSpeech = new TextToSpeech(this, new TextToSpeech.OnInitListener() {

            public void onInit(int status) {
if(status == TextToSpeech.SUCCESS)
    result=mSpeech.setLanguage(Locale.US);  
if(result==TextToSpeech.LANG_MISSING_DATA ||
result==TextToSpeech.LANG_NOT_SUPPORTED){
Log.e("error", "This Language is not supported");
}
    }
        });

And this is the code i run when the menu is clicked:

case R.id.read_aloud_menu_item:
                System.out.println("goes into read aloud case");
                System.out.println(TextToSpeech.ERROR);

                mSpeech.speak("Hello, this is a sample data", TextToSpeech.QUEUE_FLUSH, null);
Chirag
  • 335
  • 2
  • 3
  • 13
  • I never tried it with API 15 but can vouch that it's not working with API 19. Did you need headphones to hear TTS or was it audible over the default speaker? – Ε Г И І И О Aug 19 '14 at 08:14

0 Answers0