Skip to content

Instantly share code, notes, and snippets.

@Younes-Charfaoui
Created July 29, 2019 09:40
Show Gist options
  • Save Younes-Charfaoui/61314475b29cb3c140fcd0cec35bcf6a to your computer and use it in GitHub Desktop.
Save Younes-Charfaoui/61314475b29cb3c140fcd0cec35bcf6a to your computer and use it in GitHub Desktop.
private fun askSpeechInput() {
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE,Locale.getDefault())
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Hi speak something");
startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment