语音识别技术第一基础部分,
private static final int VOICE_RECOGNITION_REQUEST_CODE=1;
private ListView mList;
Button mButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mButton=(Button)findViewById(R.id.myButton);
mButton.setOnClickListener(new myRecognizerIntentListener());
mList=(ListView)findViewById(R.id.myListView);
}
public class myRecognizerIntentListener implements OnClickListener{
@Override
public void onClick(View v) {
try {
//用Intent来传递语音识别的模式,并且开启语音模式
Intent intent=new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
//语言模式和自由形式的语音识别
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerInten