timstableford / P-BrainAndroid

P-Brain Android Client
MIT License
8 stars 10 forks source link

Add Text To Speech #2

Closed timstableford closed 7 years ago

timstableford commented 7 years ago

Add text to speech on responses, handling the silent flag too. Probably using Google API's.

patrickjquinn commented 7 years ago

The native Android one should be able to handle this, something like

public static void speakResponse(String response) {
     TextToSpeech tts = new TextToSpeech(MainActivity.this, null);
     tts.setLanguage(Locale.US);
     tts.speak(response, TextToSpeech.QUEUE_ADD, null);
}
timstableford commented 7 years ago

Yeah, that's what I was thinking of. I wanted to explore open source alternatives first but I don't think I'll find anything as good.

timstableford commented 7 years ago

Now implemented.