Skip to content

Instantly share code, notes, and snippets.

@StephenVinouze
Created May 12, 2020 16:26
Show Gist options
  • Save StephenVinouze/4147c2d7ab3e3873f308033109123225 to your computer and use it in GitHub Desktop.
Save StephenVinouze/4147c2d7ab3e3873f308033109123225 to your computer and use it in GitHub Desktop.
override fun onPartialResults(partialResults: Bundle) {
val matches = partialResults.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
if (matches != null) {
// Handle partial matches
}
}
override fun onResults(results: Bundle) {
val matches = results.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION)
val scores = results.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES)
if (matches != null) {
// Handle matches
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment