Skip to content

Instantly share code, notes, and snippets.

@filipproch
Created May 22, 2017 08:26
Show Gist options
  • Save filipproch/642cb0d774ee20b94c7f84bcf77ce9aa to your computer and use it in GitHub Desktop.
Save filipproch/642cb0d774ee20b94c7f84bcf77ce9aa to your computer and use it in GitHub Desktop.
// AsrSessionOperator.kt
// nova metoda
fun setSensitivityLevel(newLevel: Float): Observable<CommandResponse> {
val bundle = Bundle()
bundle.putFloat(AsrControlCommand.EXTRA_SENSITIVITY, newLevel)
val cmd = AsrControlCommand(AsrControlCommand.CMD_UPDATE_SENSITIVITY_LEVEL, bundle)
return AsrServiceConnection.operator.sendAsrControlCommand(cmd)
}
private fun reactToStateChange(state: ActiveConfiguration) {
//... existujici kod
if (state.initialized && state.recognizing.not()) {
setSensitivityLevel(5f).subscribe() // nastavim sensitivityLevel po inicializaci ASR
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment