Handling RecognitionListener Errors

前端 未结 4 1261
旧时难觅i
旧时难觅i 2021-01-03 03:29

I am using the Android\'s speech API to continuously getting input from the user. However this doesn\'t work quite well when errors occur.

What I do is restarting th

4条回答
  •  忘掉有多难
    2021-01-03 04:08

    Intent RC = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    
            if (!RC.hasExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE))
            { 
                RC.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, "com.dummy");
            } 
    
            sr.startListening(RC);
    

提交回复
热议问题