Open ghure opened 4 years ago
In SpeechRecognitionPlugin.java, you can also change a method like this.
private Locale getLocale(String code) {
String[] localeParts;
if(code.contains("_")){
localeParts = code.split("_");
}else{
localeParts = code.split("-");
}
return new Locale(localeParts[0], localeParts[1]);
}
I had issues in android for local language recognition.
Issue was speech_recognition was not detecting selected language and was giving error java.lang.IndexOutOfBoundsException
My code: _speechRecognition .listen(locale: "en-US") .then((result) => print('$result')); });
_speechRecognition .listen(locale: "mr-IN") .then((result) => print('$result')); });
After spending long time on issue, i resolved issue by changing code in SpeechRecognitionPlugin.java -> line no 67 -> recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, call.arguments.toString());
After changing this code works fine in android. So can any one update this line in android code Thanks.