Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method ‘void java.lang.Thread.join()’ on a null object reference
com.dialoid.speech.recognition.SpeechReaderManager.stop (SpeechReaderManager.java:167)
com.dialoid.speech.recognition.SpeechRecognizer.handleOnEndPointDetect (SpeechRecognizer.java:952)
음성인식 서비스를 재시작하면 간헐적으로 이런 오류가 나오네요.
@Override
public void onReady() {
//TODO implement interface DaumSpeechRecognizeListener method
}
@Override
public void onBeginningOfSpeech() {
//TODO implement interface DaumSpeechRecognizeListener method
}
@Override
public void onEndOfSpeech() {
//TODO implement interface DaumSpeechRecognizeListener method
}
@Override
public void onError(int errorCode, String errorMsg) {
//TODO implement interface DaumSpeechRecognizeListener method
if(client!=null) {
client.cancelRecording();
client.startRecording(true);
}else{
}
//client = null;
}
@Override
public void onPartialResult(String text) {
//TODO implement interface DaumSpeechRecognizeListener method
}
boolean isin =false;
@Override
public void onResults(Bundle results) {
final StringBuilder builder = new StringBuilder();
Log.i("SpeechSampleActivity", "onResults");
ArrayList<String> texts = results.getStringArrayList(SpeechRecognizerClient.KEY_RECOGNITION_RESULTS);
ArrayList<Integer> confs = results.getIntegerArrayList(SpeechRecognizerClient.KEY_CONFIDENCE_VALUES);
//boolean isIn = false;
for (int i = 0; i < texts.size(); i++) {
if(CommonUtils.getSutterText(context).equals(texts.get(i))){
isin = true;
break;
}
}
if(isin){
shoot();
}else{
if(client!=null) {
}
}
}
@Override
public void onAudioLevel(float v) {
//TODO implement interface DaumSpeechRecognizeListener method
}
@Override
public void onFinished() {
if(!isin) {
client.startRecording(true);
}
}
이런식으로 재시작을 하고있거든요
혹시 음성인식 재시작에 관련해서 가이드가 있는지요?