我试图将乌尔都语语音翻译成英语。从今天早上开始,我就在SpeechRecognizer上工作,但是它对我不起作用。这是我的代码。
mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(getContext());
mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en-pk");
结果是:我说乌尔都语,并且转换成罗马乌尔都语或乌尔都语。不是英语。