pocketsphinx-android icon indicating copy to clipboard operation
pocketsphinx-android copied to clipboard

Final Result is only posted when calling SpeechRecognizer.stop()

Open paulpv opened this issue 9 years ago • 3 comments

I find it odd that "mainHandler.post(new ResultEvent(hypothesis, true));" is only ever called in SpeechRecognizer.stop(). I would expect the final result to be posted if the main recognizer loop timed out but had a partial result. Maybe I am missing the purpose of "Partial" results and what to expect when the thread times out or when "stop()" is called. Is my "onPartialResult" handler supposed to be handle even the final result? Should I not expect a call to "onResult" unless "stop()" is explicitly called (ex: even if there is a confident match or a timeout)?

If this is a malfunction, then I can whip together a proposed fix or two. If this is normal, then is there some better documentation, other than the demo, of how and when to handle onPartialResult and onResult?

Thanks!

paulpv avatar Sep 12 '14 22:09 paulpv

Yes, there is an issue now on timeout behavior, ideally we should extend timeout when we receive results.

nshmyrev avatar Sep 13 '14 06:09 nshmyrev

I was going to open another issue that the "timeout" is not really a timed timeout, it is a "number of samples timeout". It might make more sense to make this a [Milli] second timeout instead of a sample count timeout.

paulpv avatar Sep 13 '14 06:09 paulpv

Right, this is another valid problem. I tried to sync timeout with milliseconds but it seems on many devices there is still no match.

nshmyrev avatar Sep 13 '14 06:09 nshmyrev