Search code examples
androidtext-to-speech

Google Text to Speech


I have an application that reads a set of instructions from the parse database and reads them out as they are displayed. I changed my default text to speech from Samsung to Google and now the app reads through the instructions with no commas or intonation. I cannot seems to circumvent this by changing tts.setSpeechRate. Any ideas on how to manipulate the reading by Google text to speech so that the speech makes sense and it not one rolling sentence from one instruction to another?


Solution

  • When you construct TextToSpeech instance, use this constructor:

    TextToSpeech(Context context, TextToSpeech.OnInitListener listener, String engine);
    

    If you want to use Google TTS, input package name in engine parameter.

    Also, you can get TTS engine list that installed your phone with TextToSpeech.getEngines();.

    Find package name with this api, then make tts instance with package name.