In flight mode, press the button, a voice out of the input screen, enter the voice appeared Please re-enter on the last week can be used normally, google can not find a solution for a long time, I hope to help Offline google voice has been set up
public void onclick1(View v)
{
Intent intent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,"請說");
startActivityForResult(intent,160);
}
protected void onActivityResult(int requestCode,int resultCode,Intent data) {
if(resultCode==RESULT_OK && requestCode==160){
super.onActivityResult(requestCode, resultCode, data);
ArrayList<String> text=data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
EditText tv=(EditText)findViewById(R.id.editText1);
tv.setText(text.toString());
}
}
As far as I know, offline recognition using google's api only works on devices running Jellybean, and even for that to work, the language's packages must be installed on the target device. If you are targeting all OS versions, I'd recommend using CMUSphinx. It works offline and supports continuous speech recognition. You can try the demo here