Skip to content

Instantly share code, notes, and snippets.

@Younes-Charfaoui
Last active August 22, 2019 23:48
Show Gist options
  • Save Younes-Charfaoui/1847712ac25cadca09dde79a16010a25 to your computer and use it in GitHub Desktop.
Save Younes-Charfaoui/1847712ac25cadca09dde79a16010a25 to your computer and use it in GitHub Desktop.
private fun saySomething(something: String, queueMode: Int = TextToSpeech.QUEUE_ADD) {
val speechStatus = textToSpeech.speak(something, queueMode, null, "ID")
if (speechStatus == TextToSpeech.ERROR) {
Toast.makeText(this, "Cant use the Text to speech.", Toast.LENGTH_LONG).show()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment