Skip to content

Instantly share code, notes, and snippets.

@yektasarioglu
Created October 30, 2020 18:57
Show Gist options
  • Save yektasarioglu/8443c9c543f3d57f7d610afdfbded611 to your computer and use it in GitHub Desktop.
Save yektasarioglu/8443c9c543f3d57f7d610afdfbded611 to your computer and use it in GitHub Desktop.
startRecognizeWithSpeechPickupUI() and startRecognizeWithoutSpeechPickupUI()
private fun startRecognizeWithSpeechPickupUI() {
val intent = Intent(activity, MLAsrCaptureActivity::class.java)
.putExtra(MLAsrCaptureConstants.LANGUAGE, ENGLISH_LANGUAGE_CODE)
.putExtra(MLAsrCaptureConstants.FEATURE, MLAsrCaptureConstants.FEATURE_WORDFLUX)
startActivityForResult(intent, ASR_RESULT_CODE)
}
private fun startRecognizeWithoutSpeechPickupUI() {
val intent = Intent(MLAsrConstants.ACTION_HMS_ASR_SPEECH)
.putExtra(MLAsrCaptureConstants.LANGUAGE, ENGLISH_LANGUAGE_CODE)
.putExtra(MLAsrCaptureConstants.FEATURE, MLAsrCaptureConstants.FEATURE_WORDFLUX)
asrRecognizer.startRecognizing(intent)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment