Skip to content

Instantly share code, notes, and snippets.

@dzolnai
Created June 28, 2018 09:50
Show Gist options
  • Save dzolnai/089df6988ebfe4466877d208e3d057d4 to your computer and use it in GitHub Desktop.
Save dzolnai/089df6988ebfe4466877d208e3d057d4 to your computer and use it in GitHub Desktop.
val recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM)
// Prefer dutch language for recognition
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "nl-NL")
// Display text for the user as hint until results are available (only in overlay mode)
recognizerIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak to search...")
// Accept partial results if they come
recognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment