3

I have an app that uses Text To Speech to say info that I get from the internet.. When that info is long, It takes a lot of time to start reading.. I tried on android 2.3.6 and android 5 loliipop, It worked on android 2.3.6 without taking so much time.. The problem happened on android 5..

Here is onInit method :

public void onInit(int status) {
    if (status == TextToSpeech.SUCCESS) {
        masterSpeech.setLanguage(Locale.CANADA);

        masterSpeech.speak(info, TextToSpeech.QUEUE_ADD, null);
    }
}

Any Idea? :D

Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32
  • 1
    Check if TTS for CANADA is supported in the device you are testing. Try first testing it with US/UK and than change the locale. – Tabrej Khan Dec 15 '14 at 16:52
  • It do speak when the info is not so long.. – Muhammad Ashraf Dec 15 '14 at 17:02
  • Kindly check the documentation http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#speak(java.lang.CharSequence, int, android.os.Bundle, java.lang.String) it says the text should not be greater than getMaxSpeechInputLength() Check if it fails over this scenario. – Tabrej Khan Dec 16 '14 at 06:40

1 Answers1

3

The problem was that the text was more than the max length.. I found the solution for that here

Community
  • 1
  • 1
Muhammad Ashraf
  • 1,252
  • 1
  • 14
  • 32