Hello guies,
As i was working on and speech recognition module i encountered a mysterious bug while the listener called for the second time to listen for voice input.
Bug detail :-
When you call the listener of the SpeechRecognizer instance for the second time to take voice input it closes as soon as it starts.
Occurrence :- it only occurs in specific devices till the time i found this bug to be occur in samsung devices as well as lg g3 device.
Reason for occurrence :- The reason for the occurrence of this bug is play service, as i uninstalled the updates of play service it got resolved.
Reference :- from
this link
Resolution :- If you want to resolve this bug there are two options.
- uninstall the goole play updates and check the bug will be resolved.
Call the listening process on error example
@Override
public void onError(int i) {
StakBrowserLogger.log("StakBrowser Speech Error", i + "");
getErrorText(i);
if(i == 7 ){
if(error_time <5){
startSpeechEngine();
}else {
if(speechListener!=null){
speechListener.onVoiceResult(null);
}
error_time = 0;
}
error_time++;
}else{
if(speechListener!=null){
speechListener.onVoiceResult(null);
}
}
}
Happy coding :)
0 Comment(s)